fix EraseTxIndex usage

This commit is contained in:
Miguel Freitas 2013-07-21 18:39:20 -03:00
parent 6e1c42e963
commit 84f796be7f

View File

@ -1077,10 +1077,10 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
// undo transactions in reverse order // undo transactions in reverse order
// [MF] just remove from txIndex, no more coins // [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]; 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"); fClean = fClean && error("DisconnectBlock() : error erasing txIndex");
} }
} }