MCPcopy Create free account
hub / github.com/ElementsProject/elements / RemoveWallet

Function RemoveWallet

src/wallet/wallet.cpp:132–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132bool RemoveWallet(WalletContext& context, const std::shared_ptr<CWallet>& wallet, std::optional<bool> load_on_start, std::vector<bilingual_str>& warnings)
133{
134 assert(wallet);
135
136 interfaces::Chain& chain = wallet->chain();
137 std::string name = wallet->GetName();
138
139 // Unregister with the validation interface which also drops shared ponters.
140 wallet->m_chain_notifications_handler.reset();
141 LOCK(context.wallets_mutex);
142 std::vector<std::shared_ptr<CWallet>>::iterator i = std::find(context.wallets.begin(), context.wallets.end(), wallet);
143 if (i == context.wallets.end()) return false;
144 context.wallets.erase(i);
145
146 // Write the wallet setting
147 UpdateWalletSetting(chain, name, load_on_start, warnings);
148
149 return true;
150}
151
152bool RemoveWallet(WalletContext& context, const std::shared_ptr<CWallet>& wallet, std::optional<bool> load_on_start)
153{

Callers 7

UnloadWalletsFunction · 0.85
removeMethod · 0.85
BOOST_FIXTURE_TEST_CASEFunction · 0.85
~FuzzedWalletMethod · 0.85
unloadwalletFunction · 0.85
TestGUIFunction · 0.85

Calls 6

UpdateWalletSettingFunction · 0.85
GetNameMethod · 0.45
resetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by 4

BOOST_FIXTURE_TEST_CASEFunction · 0.68
~FuzzedWalletMethod · 0.68
TestGUIFunction · 0.68