try this to stop ztx beig removed from mempool
This commit is contained in:
22
src/main.cpp
22
src/main.cpp
@@ -4249,16 +4249,20 @@ 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);
|
||||||
|
|
||||||
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 vjoinsplit_size = tx.vjoinsplit.size();
|
int vjoinsplit_size = ;
|
||||||
|
if ( tx.vjoinsplit.size() == 0 ) {
|
||||||
//tmpmempool.addUnchecked(hash,e,!IsInitialBlockDownload());
|
tmpmempool.addUnchecked(hash,e,!IsInitialBlockDownload());
|
||||||
fprintf(stderr, "tx vjoinsplit size: %d\n",vjoinsplit_size);
|
list<CTransaction> removed;
|
||||||
|
mempool.remove(tx, removed, false);
|
||||||
|
} else {
|
||||||
|
// is a z-tx so leave it alone!
|
||||||
|
fprintf(stderr, "tx vjoinsplit size: %d\n",vjoinsplit_size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// clear the mempool before importing all block txs to mempool.
|
|
||||||
//mempool.clear();
|
|
||||||
// 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 )
|
||||||
{
|
{
|
||||||
@@ -4308,7 +4312,7 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
|
|||||||
LogPrintf("CheckBlockHeader komodo_check_deposit error");
|
LogPrintf("CheckBlockHeader komodo_check_deposit error");
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
/*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
|
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;
|
int invalidtxs = 0;
|
||||||
BOOST_FOREACH(const CTxMemPoolEntry& e, tmpmempool.mapTx) {
|
BOOST_FOREACH(const CTxMemPoolEntry& e, tmpmempool.mapTx) {
|
||||||
@@ -4319,11 +4323,11 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
|
|||||||
invalidtxs++;
|
invalidtxs++;
|
||||||
else fprintf(stderr, "added mempool tx back to mempool\n");
|
else fprintf(stderr, "added mempool tx back to mempool\n");
|
||||||
}
|
}
|
||||||
if ( 0 && invalidtxs > 0 )
|
if ( invalidtxs > 0 )
|
||||||
fprintf(stderr, "number of invalid txs: %d\n",invalidtxs );
|
fprintf(stderr, "number of invalid txs: %d\n",invalidtxs );
|
||||||
// empty the temp mempool for next time.
|
// empty the temp mempool for next time.
|
||||||
tmpmempool.clear();
|
tmpmempool.clear();
|
||||||
} */
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user