Permalink
Browse files

Fix multi-block reorg transaction resurrection

  • Loading branch information...
Tranz5 committed Aug 21, 2014
1 parent c2194fb commit c8e919dc310b732ec05a8d56ed1f4ecdcc1c18ab
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/main.cpp
@@ -1767,7 +1767,7 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
printf("REORGANIZE: Connect %"PRIszu" blocks; %s..%s\n", vConnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->GetBlockHash().ToString().substr(0,20).c_str());
// Disconnect shorter branch
vector<CTransaction> vResurrect;
list<CTransaction> vResurrect;
BOOST_FOREACH(CBlockIndex* pindex, vDisconnect)
{
CBlock block;
@@ -1779,9 +1779,9 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew)
// 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)
BOOST_REVERSE_FOREACH(const CTransaction& tx, block.vtx)
if (!(tx.IsCoinBase() || tx.IsCoinStake()) && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate())
vResurrect.push_back(tx);
vResurrect.push_front(tx);
}
// Connect longer branch

0 comments on commit c8e919d

Please sign in to comment.