Skip to content

Commit cd9af42

Browse files
knstPastaPastaPasta
authored andcommitted
chore: add TODO accordingly init order issue for g_wallet_init_interface and WalletContext
1 parent 0964068 commit cd9af42

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/test/util/setup_common.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::ve
165165
InitScriptExecutionCache();
166166
m_node.addrman = std::make_unique<CAddrMan>();
167167
m_node.chain = interfaces::MakeChain(m_node);
168+
// while g_wallet_init_interface is init here at very early stage
169+
// we can't get rid of unique_ptr from wallet/contex.h
170+
// TODO: remove unique_ptr from wallet/context.h after bitcoin/bitcoin#22219
168171
g_wallet_init_interface.Construct(m_node);
169172
fCheckBlockIndex = true;
170173
m_node.evodb = std::make_unique<CEvoDB>(1 << 20, true, true);

src/wallet/context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Loader;
2828
struct WalletContext {
2929
interfaces::Chain* chain{nullptr};
3030
ArgsManager* args{nullptr};
31+
// TODO: replace this unique_ptr to a pointer
32+
// probably possible to do after bitcoin/bitcoin#22219
3133
const std::unique_ptr<interfaces::CoinJoin::Loader>& m_coinjoin_loader;
3234

3335
//! Declare default constructor and destructor that are not inline, so code

0 commit comments

Comments
 (0)