From 5d5ec3d25f0ca0cab7d7e115ac4171ebaeb3686b Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 1 Nov 2018 23:03:35 +0800 Subject: [PATCH] try again --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 73cf8a7df..2b33ddef5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4249,20 +4249,23 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C //fprintf(stderr,"put block's tx into mempool\n"); // Copy the mempool to temporary mempool because there can be tx in local mempool that make the block invalid. LOCK(mempool.cs); - + list transactionsToRemove; BOOST_FOREACH(const CTxMemPoolEntry& e, mempool.mapTx) { const CTransaction &tx = e.GetTx(); const uint256 &hash = tx.GetHash(); int txsize = tx.vjoinsplit.size(); if ( tx.vjoinsplit.size() == 0 ) { + transactionsToRemove.push_back(tx); tmpmempool.addUnchecked(hash,e,!IsInitialBlockDownload()); - list removed; - mempool.remove(tx, removed, false); } else { // is a z-tx so leave it alone! fprintf(stderr, "tx vjoinsplit size: %d\n",txsize); } } + BOOST_FOREACH(const CTransaction& tx, transactionsToRemove) { + list removed; + remove(tx, removed, false); + } // add all the txs in the block to the empty mempool. while ( 1 ) {