aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2013-07-23 17:51:28 +0200
committerGavin Andresen <gavinandresen@gmail.com>2013-08-20 12:18:50 +1000
commit38863afbcc6ddb8a247210ac1d7c5d9717265339 (patch)
tree62a096e6280aec976dd955c44009aa7ff3f7ebe6 /src
parent6f315b4016b61672cc5490b2618b933809403d19 (diff)
downloadbitcoin-38863afbcc6ddb8a247210ac1d7c5d9717265339.tar.xz
Fix multi-block reorg transaction resurrection
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 226d32295d..effac19fb5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1778,7 +1778,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
}
// Disconnect shorter branch
- vector<CTransaction> vResurrect;
+ list<CTransaction> vResurrect;
BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) {
CBlock block;
if (!block.ReadFromDisk(pindex))
@@ -1792,9 +1792,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