Implementations of 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.
Make WalletInitInterface and DummyWalletInit private, fix nullptr deref #12836
pull promag wants to merge 2 commits into bitcoin:master from promag:2018-03-walletinit changing 10 files +58 −87-
promag commented at 8:00 AM on March 30, 2018: member
- fanquake added the label Wallet on Mar 30, 2018
-
jamesob commented at 1:44 PM on March 30, 2018: member
-
in src/init.cpp:91 in 208fad6b5e outdated
87 | + void Flush() override {} 88 | + void Stop() override {} 89 | + void Close() override {} 90 | +}; 91 | + 92 | +static DummyWalletInit g_dymmy_wallet_init;
jnewbery commented at 6:43 PM on March 30, 2018:typo
dymmy.Why does this need to be static?
promag commented at 9:02 PM on March 30, 2018:Dummy typo 😄It doesn't have to be static. IMO these can have internal linkage. WDYT?
jnewbery commented at 1:39 PM on April 2, 2018:IMO these can have internal linkage. WDYT?
Yes, seems reasonable.
MarcoFalke referenced this in commit d454e39f2a on Apr 1, 2018promag force-pushed on Apr 1, 2018jnewbery commented at 1:42 PM on April 2, 2018: memberTested ACK 57c00059bb51be64a670edebc00416fc2050d5f1 once this has been rebased on master to fix the linter error.
promag force-pushed on Apr 2, 2018promag commented at 2:19 PM on April 2, 2018: memberRebased.
jamesob commented at 3:19 PM on April 2, 2018: memberjnewbery commented at 3:46 PM on April 2, 2018: memberLooks good. ReACK 465a8eed157a637391f60d4681a5d7c6a885cdbd
instagibbs commented at 7:03 PM on April 5, 2018: member<MarcoFalke> ^ Needs rebase
laanwj assigned laanwj on Apr 5, 2018MarcoFalke renamed this:Make WalletInitInterface and DummyWalletInit private
Make WalletInitInterface and DummyWalletInit private, fix nullptr deref
on Apr 5, 2018wallet: Make WalletInitInterface and DummyWalletInit private 39bc2faa2ewallet: Refactor to WalletInitInterface* const g_wallet_init_interface d894894aabin src/init.cpp:77 in 465a8eed15 outdated
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 {
PierreRochard commented at 7:23 PM on April 5, 2018:What's the reason for moving this class from
src/walletinitinterface.h?
jamesob commented at 7:57 PM on April 5, 2018:I think the idea is to narrow the scope of this class to where it's needed and reduce unnecessary header bloat.
promag commented at 8:06 PM on April 5, 2018:Right.
promag force-pushed on Apr 5, 2018promag commented at 8:10 PM on April 5, 2018: memberRebased.
jamesob commented at 8:37 PM on April 5, 2018: memberTested ACK https://github.com/bitcoin/bitcoin/pull/12836/commits/d894894aab78dbd5e32267313237648933248377
For both
--enable-walletand--disable-wallet:- Ran
bitcoin-qt -h - Verified preexisting wallet data loaded
PierreRochard commented at 1:20 PM on April 6, 2018: contributorTested ACK d894894aab78dbd5e32267313237648933248377
Did the same as @jamesob and manually added in logging to
DummyWalletInit'sOpen()to see that it is being used with--disable-walletand not being used with--enable-walletlaanwj added the label Bug on Apr 7, 2018laanwj merged this on Apr 7, 2018laanwj closed this on Apr 7, 2018laanwj referenced this in commit 9abdb7c67e on Apr 7, 2018PastaPastaPasta referenced this in commit 0ae2a12ba0 on Mar 14, 2020PastaPastaPasta referenced this in commit 4879de76ef on Mar 19, 2020PastaPastaPasta referenced this in commit 599df2b325 on Mar 21, 2020PastaPastaPasta referenced this in commit 5fc1686919 on Mar 24, 2020PastaPastaPasta referenced this in commit 2acf2a058e on May 20, 2020UdjinM6 referenced this in commit e78db55314 on May 20, 2020UdjinM6 referenced this in commit 0662f170f0 on May 20, 2020ckti referenced this in commit 6efccd83cb on Mar 28, 2021ckti referenced this in commit f10aa62724 on Mar 28, 2021gades referenced this in commit 368a862171 on Jun 30, 2021DrahtBot locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 09:15 UTC
More mirrored repositories can be found on mirror.b10c.me