Skip to content

Commit

Permalink
[wallet] Add CloseWallets() function to wallet/init.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
John Newbery committed Sep 7, 2017
1 parent 77fe07c commit 062d631
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,7 @@ void Shutdown()
UnregisterAllValidationInterfaces();
GetMainSignals().UnregisterBackgroundSignalScheduler();
#ifdef ENABLE_WALLET
for (CWalletRef pwallet : vpwallets) {
delete pwallet;
}
vpwallets.clear();
CloseWallets();
#endif
globalVerifyHandle.reset();
ECC_Stop();
Expand Down
7 changes: 7 additions & 0 deletions src/wallet/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,10 @@ void StopWallets() {
pwallet->Flush(true);
}
}

void CloseWallets() {
for (CWalletRef pwallet : vpwallets) {
delete pwallet;
}
vpwallets.clear();
}
4 changes: 4 additions & 0 deletions src/wallet/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ void FlushWallets();

//! Stop all wallets. Wallets will be flushed first.
void StopWallets();

//! Close all wallets.
void CloseWallets();

#endif // BITCOIN_WALLET_INIT_H

0 comments on commit 062d631

Please sign in to comment.