mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-06 14:19:59 -05:00
[wallet] Add StopWallets() function to wallet/init.cpp
This commit is contained in:
parent
2da5eafa47
commit
77fe07c159
3 changed files with 14 additions and 6 deletions
|
@ -189,7 +189,7 @@ void Shutdown()
|
||||||
StopRPC();
|
StopRPC();
|
||||||
StopHTTPServer();
|
StopHTTPServer();
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
FlushWallets(false);
|
FlushWallets();
|
||||||
#endif
|
#endif
|
||||||
MapPort(false);
|
MapPort(false);
|
||||||
UnregisterValidationInterface(peerLogic.get());
|
UnregisterValidationInterface(peerLogic.get());
|
||||||
|
@ -244,7 +244,7 @@ void Shutdown()
|
||||||
pblocktree = nullptr;
|
pblocktree = nullptr;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
FlushWallets(true);
|
StopWallets();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_ZMQ
|
#if ENABLE_ZMQ
|
||||||
|
|
|
@ -246,8 +246,14 @@ bool OpenWallets()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlushWallets(bool shutdown) {
|
void FlushWallets() {
|
||||||
for (CWalletRef pwallet : vpwallets) {
|
for (CWalletRef pwallet : vpwallets) {
|
||||||
pwallet->Flush(shutdown);
|
pwallet->Flush(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void StopWallets() {
|
||||||
|
for (CWalletRef pwallet : vpwallets) {
|
||||||
|
pwallet->Flush(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@ bool VerifyWallets();
|
||||||
bool OpenWallets();
|
bool OpenWallets();
|
||||||
|
|
||||||
//! Flush all wallets in preparation for shutdown.
|
//! Flush all wallets in preparation for shutdown.
|
||||||
//! Call with shutdown = true to actually shutdown the wallet.
|
void FlushWallets();
|
||||||
void FlushWallets(bool shutdown);
|
|
||||||
|
//! Stop all wallets. Wallets will be flushed first.
|
||||||
|
void StopWallets();
|
||||||
#endif // BITCOIN_WALLET_INIT_H
|
#endif // BITCOIN_WALLET_INIT_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue