Document assumptions that are being made to avoid NULL pointer dereferences

This commit is contained in:
practicalswift
2017-08-28 09:24:17 +02:00
parent 6866b4912b
commit fdc329376c
3 changed files with 5 additions and 0 deletions

View File

@@ -519,6 +519,7 @@ void CWallet::SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator> ran
const uint256& hash = it->second;
CWalletTx* copyTo = &mapWallet[hash];
if (copyFrom == copyTo) continue;
assert(copyFrom && "Oldest wallet transaction in range assumed to have been found.");
if (!copyFrom->IsEquivalentTo(*copyTo)) continue;
copyTo->mapValue = copyFrom->mapValue;
copyTo->vOrderForm = copyFrom->vOrderForm;