From 868d041622e2f589ab4535c30ce683534b6d4f71 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 11 Nov 2014 16:41:44 -0800 Subject: Remove coinbase-dependant transactions during reorg. This still leaves transactions in mempool that are potentially invalid if the maturity period has been reorged out of, but at least they're not missing inputs entirely. --- src/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 70e3973e6..3a2c167e8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1892,9 +1892,8 @@ bool static DisconnectTip(CValidationState &state) { // ignore validation errors in resurrected transactions list removed; CValidationState stateDummy; - if (!tx.IsCoinBase()) - if (!AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL)) - mempool.remove(tx, removed, true); + if (tx.IsCoinBase() || !AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL)) + mempool.remove(tx, removed, true); } mempool.check(pcoinsTip); // Update chainActive and related variables. -- cgit v1.2.3 From 723d12c098456e7682e641076e76468a9fb0cec0 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 11 Nov 2014 20:57:54 -0800 Subject: Remove txn which are invalidated by coinbase maturity during reorg --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3a2c167e8..9e1c41ada 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1895,6 +1895,7 @@ bool static DisconnectTip(CValidationState &state) { if (tx.IsCoinBase() || !AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL)) mempool.remove(tx, removed, true); } + mempool.removeCoinbaseSpends(pcoinsTip, pindexDelete->nHeight); mempool.check(pcoinsTip); // Update chainActive and related variables. UpdateTip(pindexDelete->pprev); -- cgit v1.2.3