WalletInitInterface
don’t have to be public, so make them private. This makes the interface instantiation static. Also reduces ENABLE_WALLET
usage and removes the unnecessary src/wallet/init.h
header.
WalletInitInterface
don’t have to be public, so make them private. This makes the interface instantiation static. Also reduces ENABLE_WALLET
usage and removes the unnecessary src/wallet/init.h
header.
87+ void Flush() override {}
88+ void Stop() override {}
89+ void Close() override {}
90+};
91+
92+static DummyWalletInit g_dymmy_wallet_init;
typo dymmy
.
Why does this need to be static?
IMO these can have internal linkage. WDYT?
Yes, seems reasonable.
71@@ -72,7 +72,25 @@ static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;
72
73 std::unique_ptr<CConnman> g_connman;
74 std::unique_ptr<PeerLogicValidation> peerLogic;
75-std::unique_ptr<WalletInitInterface> g_wallet_init_interface;
76+
77+#if !(ENABLE_WALLET)
78+class DummyWalletInit : public WalletInitInterface {
src/walletinitinterface.h
?
Tested ACK https://github.com/bitcoin/bitcoin/pull/12836/commits/d894894aab78dbd5e32267313237648933248377
For both --enable-wallet
and --disable-wallet
:
bitcoin-qt -h
Tested ACK d894894aab78dbd5e32267313237648933248377
Did the same as @jamesob and manually added in logging to DummyWalletInit
’s Open()
to see that it is being used with --disable-wallet
and not being used with --enable-wallet