From 7a0832ebb09153978d96c36eec3533ecb67aa6d6 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 29 Oct 2018 21:31:31 +0800 Subject: [PATCH] fix --- src/main.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index cb07c181b..1b160097b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4307,16 +4307,19 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C LogPrintf("CheckBlockHeader komodo_check_deposit error"); return(false); } - int invalidtxs = 0; - BOOST_FOREACH(const CTxMemPoolEntry& e, tmpmempool.mapTx) { - const CTransaction &tx = e.GetTx(); - if ( myAddtomempool(tx) == false ) // this happens if there were invalid txs in the local mempool, on block arrival, used to make the block invalid. - invalidtxs++; - fprintf(stderr, "added mempool tx back to mempool\n"); + if ( ASSETCHAINS_CC != 0 ) // CC contracts might refer to transactions in the current block, from a CC spend within the same block and out of order + { + int invalidtxs = 0; + BOOST_FOREACH(const CTxMemPoolEntry& e, tmpmempool.mapTx) { + const CTransaction &tx = e.GetTx(); + if ( myAddtomempool(tx) == false ) // this happens if there were invalid txs in the local mempool, on block arrival, used to make the block invalid. + invalidtxs++; + fprintf(stderr, "added mempool tx back to mempool\n"); + } + fprintf(stderr, "number of invalid txs: %d\n",invalidtxs ); + // empty the temp mempool for next time. + tmpmempool.clear(); } - fprintf(stderr, "number of invalid txs: %d\n",invalidtxs ); - // empty the temp mempool for next time. - tmpmempool.clear(); return true; }