diff options
author | Matt Corallo <git@bluematt.me> | 2013-07-23 17:51:28 +0200 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2013-07-23 18:02:27 +0200 |
commit | 9bf2a4aba2c22dc451ce000f7ef081b3d3562b84 (patch) | |
tree | 0e9240e9dd601917eb4afe36d85df8aa20f8c0ba | |
parent | d9ace8abe804a4134e5e77a0f9f82a52ea339762 (diff) |
Fix multi-block reorg transaction resurrection
-rw-r--r-- | src/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 881580a85b..c8b4876c3e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1938,7 +1938,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew) } // Disconnect shorter branch - vector<CTransaction> vResurrect; + list<CTransaction> vResurrect; BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) { CBlock block; if (!ReadBlockFromDisk(block, pindex)) @@ -1952,9 +1952,9 @@ bool SetBestChain(CValidationState &state, 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() && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate()) - vResurrect.push_back(tx); + vResurrect.push_front(tx); } // Connect longer branch |