We’ve been quite successful in eliminating these lately (#7905, #7691).
It would be nice to disentangle the wallet and non-wallet initialization completely so that init.cpp no longer depends on the wallet (and thus, libbitcoin_server.a
no longer depends on libbitcoin_wallet.a
- the other way is fine, a circular dependency is not).
Ignoring the GUI for now (which still needs some work in this direction), the following are left:
init.cpp
: these are mostly self-contained and short. (#10762)- print BerkeleyDB version should probably be moved to
CWallet::InitLoadWallet
CWallet::Verify
(fixed in #8036). - wallet-specfic option interaction (
-walletbroadcast
,-prune
+-rescan
) should move to wallet module (possibly a new call that can be called in addition toInitParameterInteraction()
) - printing setKeyPool size etc should probably be moved to
CWallet::InitLoadWallet
. - wallet initialization/verify/shutdown - maybe this could be replaced by a general registration system for initialization/interrupt/shutdown functions, called as signals in the appropriate places. The same could be used by other modules
-
-disablewallet
could result in the wallet not being registered at all, and that can all be handled from outside init.
- print BerkeleyDB version should probably be moved to
- RPC still has some calls that vary depending on wallet support. We should split these up. This is the more annoying part as it will involve API changes. No non-wallet RPC call should make an assumption about “a wallet”.
rpcmisc.cpp
-
getinfo
- this call is already on the list to be deprecated for a long time (#10838) -
validateaddress
- should be split up into an utility-onlyvalidateaddress
and a wallet-specific callgetaddressinfo
(name open for discussion) (#10583) -
createmultisig
- same.createmultisig
andwalletcreatemultisig
or so (#11415)
-
-
rpcblockchain.cpp
-
signrawtransaction
- should be split into an utility-onlysignrawtransaction
and a wallet-specific callwalletsignrawtransaction
(#10579)
-
- remove deprecated
validateaddress
andsignrawtransaction
wallet dependency completely (#12490)
- Mining: no
ENABLE_WALLET
but an implicit assumption and a circuitous registration system. Thegenerate
call should be a wallet-specific call, whereasgeneratetoaddress
is core. See discussion in #6481. (done in #10683). - in
httprpc.cpp
, there are #ifdef ENABLE_WALLETs protecting registration/unregistration of the wallet endpoint. These can trivially be replaced with calls into the WalletInitInterface. - in
interfaces/node.cpp
, #ifdef ENABLE_WALLET protects the calls to getWallets(). This can easily be replaced by calls into a wallet manager/dummy wallet manager.
The first phase would be to introduce the new (wallet-only) methods, then a release later remove wallet functionality from the core-only calls.