aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-12-01 00:41:27 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-12-01 02:09:41 +0100
commit8259c573212213e3cd8da7146af525e067c4ddaa (patch)
treeba65201c56df0b5f04728454f4bb5c8c396bd117 /src/main.cpp
parent038784b97959c63751bc75c9d1a9456962120ff0 (diff)
downloadbitcoin-8259c573212213e3cd8da7146af525e067c4ddaa.tar.xz
Only send reorged txn to mempool after checkpoint
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a63aa74a64..320834e981 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1704,9 +1704,11 @@ bool SetBestChain(CBlockIndex* pindexNew)
if (!viewTemp.Flush())
return error("SetBestBlock() : Cache flush failed after disconnect");
- // 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);
}