|
|
@ -729,7 +729,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD |
|
|
|
|
|
|
|
|
|
|
|
// Write to disk
|
|
|
|
// Write to disk
|
|
|
|
if (fInsertedNew || fUpdated) |
|
|
|
if (fInsertedNew || fUpdated) |
|
|
|
if (!wtx.WriteToDisk(pwalletdb)) |
|
|
|
if (!pwalletdb->WriteTx(wtx)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
// Break debit/credit balance caches:
|
|
|
|
// Break debit/credit balance caches:
|
|
|
@ -829,7 +829,7 @@ bool CWallet::AbandonTransaction(const uint256& hashTx) |
|
|
|
wtx.nIndex = -1; |
|
|
|
wtx.nIndex = -1; |
|
|
|
wtx.setAbandoned(); |
|
|
|
wtx.setAbandoned(); |
|
|
|
wtx.MarkDirty(); |
|
|
|
wtx.MarkDirty(); |
|
|
|
wtx.WriteToDisk(&walletdb); |
|
|
|
walletdb.WriteTx(wtx); |
|
|
|
NotifyTransactionChanged(this, wtx.GetHash(), CT_UPDATED); |
|
|
|
NotifyTransactionChanged(this, wtx.GetHash(), CT_UPDATED); |
|
|
|
// Iterate over all its outputs, and mark transactions in the wallet that spend them abandoned too
|
|
|
|
// 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)); |
|
|
|
TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(hashTx, 0)); |
|
|
@ -891,7 +891,7 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx) |
|
|
|
wtx.nIndex = -1; |
|
|
|
wtx.nIndex = -1; |
|
|
|
wtx.hashBlock = hashBlock; |
|
|
|
wtx.hashBlock = hashBlock; |
|
|
|
wtx.MarkDirty(); |
|
|
|
wtx.MarkDirty(); |
|
|
|
wtx.WriteToDisk(&walletdb); |
|
|
|
walletdb.WriteTx(wtx); |
|
|
|
// Iterate over all its outputs, and mark transactions in the wallet that spend them conflicted too
|
|
|
|
// 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)); |
|
|
|
TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0)); |
|
|
|
while (iter != mapTxSpends.end() && iter->first.hash == now) { |
|
|
|
while (iter != mapTxSpends.end() && iter->first.hash == now) { |
|
|
@ -1186,12 +1186,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 |
|
|
|
* Scan the block chain (starting in pindexStart) for transactions |
|
|
|
* from or to us. If fUpdate is true, found transactions that already |
|
|
|
* from or to us. If fUpdate is true, found transactions that already |
|
|
@ -3194,7 +3188,7 @@ bool CWallet::InitLoadWallet() |
|
|
|
copyTo->fFromMe = copyFrom->fFromMe; |
|
|
|
copyTo->fFromMe = copyFrom->fFromMe; |
|
|
|
copyTo->strFromAccount = copyFrom->strFromAccount; |
|
|
|
copyTo->strFromAccount = copyFrom->strFromAccount; |
|
|
|
copyTo->nOrderPos = copyFrom->nOrderPos; |
|
|
|
copyTo->nOrderPos = copyFrom->nOrderPos; |
|
|
|
copyTo->WriteToDisk(&walletdb); |
|
|
|
walletdb.WriteTx(*copyTo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|