diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-12-05 14:15:17 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-12-05 14:15:17 -0800 |
commit | cd1391ae4d744243fa3183f9a93d09ad812d4468 (patch) | |
tree | 83a6bf65ddaf3c5b5750ebb158a9234dd817ea98 | |
parent | a485c1b69e282883414dfb387d0aac1cfa21533d (diff) | |
parent | 8259c573212213e3cd8da7146af525e067c4ddaa (diff) |
Merge pull request #2056 from sipa/fix_2052
Fixes for obscure mempool-checkpoint interaction
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 84571e11ef..756b8ff3d9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1723,9 +1723,11 @@ bool SetBestChain(CBlockIndex* pindexNew) if (!block.DisconnectBlock(pindex, view)) return error("SetBestBlock() : DisconnectBlock %s failed", BlockHashStr(pindex->GetBlockHash()).c_str()); - // Queue memory transactions to resurrect + // 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()) + if (!tx.IsCoinBase() && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate()) vResurrect.push_back(tx); } @@ -1774,7 +1776,7 @@ bool SetBestChain(CBlockIndex* pindexNew) // Resurrect memory transactions that were in the disconnected branch BOOST_FOREACH(CTransaction& tx, vResurrect) - tx.AcceptToMemoryPool(false); + tx.AcceptToMemoryPool(); // Delete redundant memory transactions that are in the connected branch BOOST_FOREACH(CTransaction& tx, vDelete) { |