try again

This commit is contained in:
blackjok3r
2018-11-01 23:03:35 +08:00
parent 3e3ce74e96
commit 5d5ec3d25f

View File

@@ -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"); //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. // Copy the mempool to temporary mempool because there can be tx in local mempool that make the block invalid.
LOCK(mempool.cs); LOCK(mempool.cs);
list<CTransaction> transactionsToRemove;
BOOST_FOREACH(const CTxMemPoolEntry& e, mempool.mapTx) { BOOST_FOREACH(const CTxMemPoolEntry& e, mempool.mapTx) {
const CTransaction &tx = e.GetTx(); const CTransaction &tx = e.GetTx();
const uint256 &hash = tx.GetHash(); const uint256 &hash = tx.GetHash();
int txsize = tx.vjoinsplit.size(); int txsize = tx.vjoinsplit.size();
if ( tx.vjoinsplit.size() == 0 ) { if ( tx.vjoinsplit.size() == 0 ) {
transactionsToRemove.push_back(tx);
tmpmempool.addUnchecked(hash,e,!IsInitialBlockDownload()); tmpmempool.addUnchecked(hash,e,!IsInitialBlockDownload());
list<CTransaction> removed;
mempool.remove(tx, removed, false);
} else { } else {
// is a z-tx so leave it alone! // is a z-tx so leave it alone!
fprintf(stderr, "tx vjoinsplit size: %d\n",txsize); fprintf(stderr, "tx vjoinsplit size: %d\n",txsize);
} }
} }
BOOST_FOREACH(const CTransaction& tx, transactionsToRemove) {
list<CTransaction> removed;
remove(tx, removed, false);
}
// add all the txs in the block to the empty mempool. // add all the txs in the block to the empty mempool.
while ( 1 ) while ( 1 )
{ {