mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
[wallet] Add FlushWallets() function to wallet/init.cpp
This commit is contained in:
parent
1b9cee66e1
commit
2da5eafa47
3 changed files with 11 additions and 6 deletions
|
@ -189,9 +189,7 @@ void Shutdown()
|
||||||
StopRPC();
|
StopRPC();
|
||||||
StopHTTPServer();
|
StopHTTPServer();
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
for (CWalletRef pwallet : vpwallets) {
|
FlushWallets(false);
|
||||||
pwallet->Flush(false);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
MapPort(false);
|
MapPort(false);
|
||||||
UnregisterValidationInterface(peerLogic.get());
|
UnregisterValidationInterface(peerLogic.get());
|
||||||
|
@ -246,9 +244,7 @@ void Shutdown()
|
||||||
pblocktree = nullptr;
|
pblocktree = nullptr;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
for (CWalletRef pwallet : vpwallets) {
|
FlushWallets(true);
|
||||||
pwallet->Flush(true);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_ZMQ
|
#if ENABLE_ZMQ
|
||||||
|
|
|
@ -245,3 +245,9 @@ bool OpenWallets()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FlushWallets(bool shutdown) {
|
||||||
|
for (CWalletRef pwallet : vpwallets) {
|
||||||
|
pwallet->Flush(shutdown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -22,4 +22,7 @@ bool VerifyWallets();
|
||||||
//! Load wallet databases.
|
//! Load wallet databases.
|
||||||
bool OpenWallets();
|
bool OpenWallets();
|
||||||
|
|
||||||
|
//! Flush all wallets in preparation for shutdown.
|
||||||
|
//! Call with shutdown = true to actually shutdown the wallet.
|
||||||
|
void FlushWallets(bool shutdown);
|
||||||
#endif // BITCOIN_WALLET_INIT_H
|
#endif // BITCOIN_WALLET_INIT_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue