{
CCoinsViewCache view(pcoinsTip);
bool rv = ConnectBlock(*pblock, state, pindexNew, view, chainparams, false, true);
+ RemoveCoinbaseFromMemPool(*pblock);
KOMODO_CONNECTING = -1;
GetMainSignals().BlockChecked(*pblock, state);
if (!rv) {
- RemoveCoinbaseFromMemPool(*pblock);
if (state.IsInvalid())
InvalidBlockFound(pindexNew, state, chainparams);
return error("ConnectTip(): ConnectBlock %s failed", pindexNew->GetBlockHash().ToString());
CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_V2;
}
+ RemoveCoinbaseFromMemPool(*pblock);
return true;
}
RemoveCoinbaseFromMemPool(block);
return error("VerifyDB(): *** found unconnectable block at %d, hash=%s", pindex->GetHeight(), pindex->GetBlockHash().ToString());
}
+ RemoveCoinbaseFromMemPool(block);
}
}
void CTxMemPool::removeExpired(unsigned int nBlockHeight)
{
CBlockIndex *tipindex;
- // Remove expired txs from the mempool
+ // Remove expired txs and leftover coinbases from the mempool
LOCK(cs);
list<CTransaction> transactionsToRemove;
for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++)
{
const CTransaction& tx = it->GetTx();
tipindex = chainActive.LastTip();
- if (IsExpiredTx(tx, nBlockHeight) || (ASSETCHAINS_SYMBOL[0] == 0 && tipindex != 0 && komodo_validate_interest(tx,tipindex->GetHeight()+1,tipindex->GetMedianTimePast() + 777,0)) < 0)
+ if (tx.IsCoinBase() || IsExpiredTx(tx, nBlockHeight))
{
transactionsToRemove.push_back(tx);
}