mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Call RemoveConflictedTx from BlockConnected instead of ProcessNewTransaction
This commit is contained in:
parent
b36f0a324f
commit
b645757be9
@ -962,17 +962,6 @@ void CInstantSendManager::ProcessNewTransaction(const CTransactionRef& tx, const
|
|||||||
|
|
||||||
bool inMempool = mempool.get(tx->GetHash()) != nullptr;
|
bool inMempool = mempool.get(tx->GetHash()) != nullptr;
|
||||||
|
|
||||||
// Are we called from validation.cpp/MemPoolConflictRemovalTracker?
|
|
||||||
// TODO refactor this when we backport the BlockConnected signal from Bitcoin, as it gives better info about
|
|
||||||
// conflicted TXs
|
|
||||||
bool isConflictRemoved = pindex == nullptr && posInBlock == -1 && !inMempool;
|
|
||||||
|
|
||||||
if (isConflictRemoved) {
|
|
||||||
LOCK(cs);
|
|
||||||
RemoveConflictedTx(*tx);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint256 islockHash;
|
uint256 islockHash;
|
||||||
{
|
{
|
||||||
LOCK(cs);
|
LOCK(cs);
|
||||||
@ -1019,6 +1008,13 @@ void CInstantSendManager::BlockConnected(const std::shared_ptr<const CBlock>& pb
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!vtxConflicted.empty()) {
|
||||||
|
LOCK(cs);
|
||||||
|
for (const auto& tx : vtxConflicted) {
|
||||||
|
RemoveConflictedTx(*tx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto& tx : pblock->vtx) {
|
for (const auto& tx : pblock->vtx) {
|
||||||
ProcessNewTransaction(tx, pindex);
|
ProcessNewTransaction(tx, pindex);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user