]> Git Repo - VerusCoin.git/commitdiff
Fix accretion of coinbases in mempool
authormiketout <[email protected]>
Mon, 30 Dec 2019 02:25:38 +0000 (18:25 -0800)
committermiketout <[email protected]>
Mon, 30 Dec 2019 02:25:38 +0000 (18:25 -0800)
src/main.cpp
src/txmempool.cpp

index 3e4ca2dc9619c2eedc9fc0f20d206bb4056b9154..58e2baea4c23a04903273d821f5b4b25bee17e6a 100644 (file)
@@ -4280,10 +4280,10 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
     {
         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());
@@ -5765,6 +5765,7 @@ bool ProcessNewBlock(bool from_miner, int32_t height, CValidationState &state, c
         CScript::MAX_SCRIPT_ELEMENT_SIZE = MAX_SCRIPT_ELEMENT_SIZE_V2;
     }
 
+    RemoveCoinbaseFromMemPool(*pblock);
     return true;
 }
 
@@ -6288,6 +6289,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
                 RemoveCoinbaseFromMemPool(block);
                 return error("VerifyDB(): *** found unconnectable block at %d, hash=%s", pindex->GetHeight(), pindex->GetBlockHash().ToString());
             }
+            RemoveCoinbaseFromMemPool(block);
         }
     }
     
index bf98a1513a63133254288b65223381c6d449dc65..2ecc39b34b759e0f85a593f032ec51adfcd80ec3 100644 (file)
@@ -567,14 +567,14 @@ extern char ASSETCHAINS_SYMBOL[];
 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);
         }
This page took 0.044375 seconds and 4 git commands to generate.