Skip to content

Commit 77fe07c

Browse files
committed
[wallet] Add StopWallets() function to wallet/init.cpp
1 parent 2da5eaf commit 77fe07c

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void Shutdown()
189189
StopRPC();
190190
StopHTTPServer();
191191
#ifdef ENABLE_WALLET
192-
FlushWallets(false);
192+
FlushWallets();
193193
#endif
194194
MapPort(false);
195195
UnregisterValidationInterface(peerLogic.get());
@@ -244,7 +244,7 @@ void Shutdown()
244244
pblocktree = nullptr;
245245
}
246246
#ifdef ENABLE_WALLET
247-
FlushWallets(true);
247+
StopWallets();
248248
#endif
249249

250250
#if ENABLE_ZMQ

src/wallet/init.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,14 @@ bool OpenWallets()
246246
return true;
247247
}
248248

249-
void FlushWallets(bool shutdown) {
249+
void FlushWallets() {
250250
for (CWalletRef pwallet : vpwallets) {
251-
pwallet->Flush(shutdown);
251+
pwallet->Flush(false);
252+
}
253+
}
254+
255+
void StopWallets() {
256+
for (CWalletRef pwallet : vpwallets) {
257+
pwallet->Flush(true);
252258
}
253259
}

src/wallet/init.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ bool VerifyWallets();
2323
bool OpenWallets();
2424

2525
//! Flush all wallets in preparation for shutdown.
26-
//! Call with shutdown = true to actually shutdown the wallet.
27-
void FlushWallets(bool shutdown);
26+
void FlushWallets();
27+
28+
//! Stop all wallets. Wallets will be flushed first.
29+
void StopWallets();
2830
#endif // BITCOIN_WALLET_INIT_H

0 commit comments

Comments
 (0)