mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Merge #15390: [wallet-tool] Close bdb when flushing wallet
318b1f7af1
[wallet] Close bdb when flushing wallet. (John Newbery)
Pull request description:
bdb would not be closed when closing the wallet in wallet-tool. Fix this by calling wallet->flush with true.
Tree-SHA512: f722e527e4806eca5254221e944f57853d11bf89a9264309fa558a6cc2b23feefb7bb2963e87b4fad9cfb31ac4cffe563688988e0614a481a8ff1d393aceb132
This commit is contained in:
commit
9c4a90040d
@ -17,7 +17,7 @@ namespace WalletTool {
|
||||
static void WalletToolReleaseWallet(CWallet* wallet)
|
||||
{
|
||||
wallet->WalletLogPrintf("Releasing wallet\n");
|
||||
wallet->Flush();
|
||||
wallet->Flush(true);
|
||||
delete wallet;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ bool ExecuteWalletToolFunc(const std::string& command, const std::string& name)
|
||||
std::shared_ptr<CWallet> wallet_instance = CreateWallet(name, path);
|
||||
if (wallet_instance) {
|
||||
WalletShowInfo(wallet_instance.get());
|
||||
wallet_instance->Flush();
|
||||
wallet_instance->Flush(true);
|
||||
}
|
||||
} else if (command == "info") {
|
||||
if (!fs::exists(path)) {
|
||||
@ -127,7 +127,7 @@ bool ExecuteWalletToolFunc(const std::string& command, const std::string& name)
|
||||
std::shared_ptr<CWallet> wallet_instance = LoadWallet(name, path);
|
||||
if (!wallet_instance) return false;
|
||||
WalletShowInfo(wallet_instance.get());
|
||||
wallet_instance->Flush();
|
||||
wallet_instance->Flush(true);
|
||||
} else {
|
||||
fprintf(stderr, "Invalid command: %s\n", command.c_str());
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user