diff --git a/src/cheatcatcher.cpp b/src/cheatcatcher.cpp index 27c5e4746..396c2d9bd 100644 --- a/src/cheatcatcher.cpp +++ b/src/cheatcatcher.cpp @@ -63,6 +63,9 @@ bool CCheatList::IsCheatInList(const CTransaction &tx, CTransaction *cheatTx) { LOCK(cs_cheat); range = indexedCheatCandidates.equal_range(utxo); + + printf("IsCheatInList - found candidates: %s\n", range.first == range.second ? "false" : "true"); + for (auto it = range.first; it != range.second; it++) { CTransaction &cTx = it->second->tx; @@ -108,12 +111,13 @@ void CCheatList::Remove(const CTxHolder &txh) uint256 hash = txh.tx.GetHash(); if (hash == it->second->tx.GetHash()) { - utxoPrune.push_back(it); auto hrange = orderedCheatCandidates.equal_range(it->second->height); for (auto hit = hrange.first; hit != hrange.second; hit++) { if (hit->second.tx.GetHash() == hash) { + // add and remove them together + utxoPrune.push_back(it); heightPrune.push_back(hit); } } diff --git a/src/cheatcatcher.h b/src/cheatcatcher.h index cff210c85..001b98257 100644 --- a/src/cheatcatcher.h +++ b/src/cheatcatcher.h @@ -65,6 +65,7 @@ class CCheatList bool IsHeightOrGreaterInList(uint32_t height) { auto range = orderedCheatCandidates.equal_range(height); + printf("IsHeightOrGreaterInList: %s\n", range.first == orderedCheatCandidates.end() ? "false" : "true"); return (range.first == orderedCheatCandidates.end()); }