mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 14:18:58 +02:00
Fix multi-block reorg transaction resurrection
This commit is contained in:
committed by
Gavin Andresen
parent
6f315b4016
commit
38863afbcc
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user