diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-03-29 11:14:47 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-03-29 11:15:02 +0200 |
commit | b35a59179359709df21eb026d35f4124ce90fbd1 (patch) | |
tree | 48cb49647f14ec9cb8f9259500b52d96250e1821 /src/wallet/wallet.cpp | |
parent | 2676e12016dbe638382e01fa562583186b73bb40 (diff) | |
parent | f1bb13c93da5d4bedf9dd2cd7357008376e9a2b4 (diff) | |
download | bitcoin-b35a59179359709df21eb026d35f4124ce90fbd1.tar.xz |
Merge #7558: [RPC] Add import/removeprunedfunds rpc call
f1bb13c Added companion removeprunedfunds call. (instagibbs)
7eb7029 Add importprunedfunds rpc call (instagibbs)
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 e85ccd2135..1ea8d2ffe7 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2353,6 +2353,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) { |