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:
MarcoFalke 2019-02-13 15:49:10 -05:00
commit 9c4a90040d
No known key found for this signature in database
GPG Key ID: D2EA4850E7528B25

View File

@ -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;