diff options
author | instagibbs <gsanders87@gmail.com> | 2016-03-07 08:51:06 -0500 |
---|---|---|
committer | instagibbs <gsanders87@gmail.com> | 2016-03-23 10:40:38 -0400 |
commit | f1bb13c93da5d4bedf9dd2cd7357008376e9a2b4 (patch) | |
tree | 402e4fd30562dc5c4a6e438961b0387ec87c8e3a /src/wallet/wallet.cpp | |
parent | 7eb702954ed0e297c5ded548e6c4f11f55313b7a (diff) |
Added companion removeprunedfunds call.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7d1928dd6a..801ef98684 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2362,6 +2362,31 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet) return DB_LOAD_OK; } +DBErrors CWallet::ZapSelectTx(vector<uint256>& vHashIn, vector<uint256>& vHashOut) +{ + if (!fFileBacked) + return DB_LOAD_OK; + DBErrors nZapSelectTxRet = CWalletDB(strWalletFile,"cr+").ZapSelectTx(this, vHashIn, vHashOut); + if (nZapSelectTxRet == DB_NEED_REWRITE) + { + if (CDB::Rewrite(strWalletFile, "\x04pool")) + { + LOCK(cs_wallet); + setKeyPool.clear(); + // Note: can't top-up keypool here, because wallet is locked. + // User will be prompted to unlock wallet the next operation + // that requires a new key. + } + } + + if (nZapSelectTxRet != DB_LOAD_OK) + return nZapSelectTxRet; + + MarkDirty(); + + return DB_LOAD_OK; + +} DBErrors CWallet::ZapWalletTx(std::vector<CWalletTx>& vWtx) { |