From 84f796be7f144ae18cdb4fd137a9a46eda9dd44f Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sun, 21 Jul 2013 18:39:20 -0300 Subject: [PATCH] fix EraseTxIndex usage --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e9168762..100c3cd9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1077,10 +1077,10 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex // undo transactions in reverse order // [MF] just remove from txIndex, no more coins - for (int i = block.vtx.size() - 1; i >= 0; i--) { + for (int i = block.vtx.size() - 1; i >= 1; i--) { const CTransaction &tx = block.vtx[i]; - if( i > 0 && pblocktree->EraseTxIndex(tx.GetUsernameHash()) ) { + if( !pblocktree->EraseTxIndex(tx.GetUsernameHash()) ) { fClean = fClean && error("DisconnectBlock() : error erasing txIndex"); } }