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
1 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ namespace WalletTool {
|
||||||
static void WalletToolReleaseWallet(CWallet* wallet)
|
static void WalletToolReleaseWallet(CWallet* wallet)
|
||||||
{
|
{
|
||||||
wallet->WalletLogPrintf("Releasing wallet\n");
|
wallet->WalletLogPrintf("Releasing wallet\n");
|
||||||
wallet->Flush();
|
wallet->Flush(true);
|
||||||
delete wallet;
|
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);
|
std::shared_ptr<CWallet> wallet_instance = CreateWallet(name, path);
|
||||||
if (wallet_instance) {
|
if (wallet_instance) {
|
||||||
WalletShowInfo(wallet_instance.get());
|
WalletShowInfo(wallet_instance.get());
|
||||||
wallet_instance->Flush();
|
wallet_instance->Flush(true);
|
||||||
}
|
}
|
||||||
} else if (command == "info") {
|
} else if (command == "info") {
|
||||||
if (!fs::exists(path)) {
|
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);
|
std::shared_ptr<CWallet> wallet_instance = LoadWallet(name, path);
|
||||||
if (!wallet_instance) return false;
|
if (!wallet_instance) return false;
|
||||||
WalletShowInfo(wallet_instance.get());
|
WalletShowInfo(wallet_instance.get());
|
||||||
wallet_instance->Flush();
|
wallet_instance->Flush(true);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Invalid command: %s\n", command.c_str());
|
fprintf(stderr, "Invalid command: %s\n", command.c_str());
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue