mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
Merge pull request #813 from dooglus/master
Fix #794. Only remove transactions from memory pool when they're actually in the memory pool.
This commit is contained in:
commit
b0cfef3214
14
src/main.cpp
14
src/main.cpp
@ -618,11 +618,15 @@ bool CTransaction::RemoveFromMemoryPool()
|
|||||||
// Remove transaction from memory pool
|
// Remove transaction from memory pool
|
||||||
CRITICAL_BLOCK(cs_mapTransactions)
|
CRITICAL_BLOCK(cs_mapTransactions)
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(const CTxIn& txin, vin)
|
uint256 hash = GetHash();
|
||||||
mapNextTx.erase(txin.prevout);
|
if (mapTransactions.count(hash))
|
||||||
mapTransactions.erase(GetHash());
|
{
|
||||||
nTransactionsUpdated++;
|
BOOST_FOREACH(const CTxIn& txin, vin)
|
||||||
--nPooledTx;
|
mapNextTx.erase(txin.prevout);
|
||||||
|
mapTransactions.erase(hash);
|
||||||
|
nTransactionsUpdated++;
|
||||||
|
--nPooledTx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user