diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-05-10 15:51:11 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-05-10 15:51:34 +0200 |
| commit | 373b50debaa995ee1f55a5a6504b628aeac9a80f (patch) | |
| tree | cc959b887b258315f444595e60fcdd2e43359379 /src/wallet/wallet.cpp | |
| parent | Merge #8036: init: Move berkeleydb version reporting to wallet (diff) | |
| parent | Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk (diff) | |
| download | discoin-373b50debaa995ee1f55a5a6504b628aeac9a80f.tar.xz discoin-373b50debaa995ee1f55a5a6504b628aeac9a80f.zip | |
Merge #8028: Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk
0fd5997 Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk (Patrick Strateman)
Diffstat (limited to 'src/wallet/wallet.cpp')
| -rw-r--r-- | src/wallet/wallet.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d32fe43ed..a18b669b3 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -730,7 +730,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD // Write to disk if (fInsertedNew || fUpdated) - if (!wtx.WriteToDisk(pwalletdb)) + if (!pwalletdb->WriteTx(wtx)) return false; // Break debit/credit balance caches: @@ -830,7 +830,7 @@ bool CWallet::AbandonTransaction(const uint256& hashTx) wtx.nIndex = -1; wtx.setAbandoned(); wtx.MarkDirty(); - wtx.WriteToDisk(&walletdb); + walletdb.WriteTx(wtx); NotifyTransactionChanged(this, wtx.GetHash(), CT_UPDATED); // Iterate over all its outputs, and mark transactions in the wallet that spend them abandoned too TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(hashTx, 0)); @@ -892,7 +892,7 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx) wtx.nIndex = -1; wtx.hashBlock = hashBlock; wtx.MarkDirty(); - wtx.WriteToDisk(&walletdb); + walletdb.WriteTx(wtx); // Iterate over all its outputs, and mark transactions in the wallet that spend them conflicted too TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0)); while (iter != mapTxSpends.end() && iter->first.hash == now) { @@ -1187,12 +1187,6 @@ void CWalletTx::GetAccountAmounts(const string& strAccount, CAmount& nReceived, } } - -bool CWalletTx::WriteToDisk(CWalletDB *pwalletdb) -{ - return pwalletdb->WriteTx(GetHash(), *this); -} - /** * Scan the block chain (starting in pindexStart) for transactions * from or to us. If fUpdate is true, found transactions that already @@ -3195,7 +3189,7 @@ bool CWallet::InitLoadWallet() copyTo->fFromMe = copyFrom->fFromMe; copyTo->strFromAccount = copyFrom->strFromAccount; copyTo->nOrderPos = copyFrom->nOrderPos; - copyTo->WriteToDisk(&walletdb); + walletdb.WriteTx(*copyTo); } } } |