Skip to content

Commit

Permalink
Only send reorged txn to mempool after checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranz5 committed Aug 21, 2014
1 parent 70ecab0 commit c2194fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,8 +1777,10 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
return error("Reorganize() : DisconnectBlock %s failed", pindex->GetBlockHash().ToString().substr(0,20).c_str());

// Queue memory transactions to resurrect
// We only do this for blocks after the last checkpoint (reorganisation before that
// point should only happen with -reindex/-loadblock, or a misbehaving peer.
BOOST_FOREACH(const CTransaction& tx, block.vtx)
if (!(tx.IsCoinBase() || tx.IsCoinStake()))
if (!(tx.IsCoinBase() || tx.IsCoinStake()) && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate())
vResurrect.push_back(tx);
}

Expand Down

0 comments on commit c2194fb

Please sign in to comment.