Skip to content

Commit 062d631

Browse files
committed
[wallet] Add CloseWallets() function to wallet/init.cpp
1 parent 77fe07c commit 062d631

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/init.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,7 @@ void Shutdown()
265265
UnregisterAllValidationInterfaces();
266266
GetMainSignals().UnregisterBackgroundSignalScheduler();
267267
#ifdef ENABLE_WALLET
268-
for (CWalletRef pwallet : vpwallets) {
269-
delete pwallet;
270-
}
271-
vpwallets.clear();
268+
CloseWallets();
272269
#endif
273270
globalVerifyHandle.reset();
274271
ECC_Stop();

src/wallet/init.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,10 @@ void StopWallets() {
257257
pwallet->Flush(true);
258258
}
259259
}
260+
261+
void CloseWallets() {
262+
for (CWalletRef pwallet : vpwallets) {
263+
delete pwallet;
264+
}
265+
vpwallets.clear();
266+
}

src/wallet/init.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ void FlushWallets();
2727

2828
//! Stop all wallets. Wallets will be flushed first.
2929
void StopWallets();
30+
31+
//! Close all wallets.
32+
void CloseWallets();
33+
3034
#endif // BITCOIN_WALLET_INIT_H

0 commit comments

Comments
 (0)