Skip to content

Commit 3a1d3e8

Browse files
committed
Merge pull request #5985
14d4eef Fix removing of orphan transactions (Alex Morcos)
2 parents e54ff2f + 14d4eef commit 3a1d3e8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4322,7 +4322,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
43224322
mempool.check(pcoinsTip);
43234323
RelayTransaction(tx);
43244324
vWorkQueue.push_back(inv.hash);
4325-
vEraseQueue.push_back(inv.hash);
43264325

43274326
LogPrint("mempool", "AcceptToMemoryPool: peer=%d %s: accepted %s (poolsz %u)\n",
43284327
pfrom->id, pfrom->cleanSubVer,
@@ -4349,7 +4348,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
43494348
// anyone relaying LegitTxX banned)
43504349
CValidationState stateDummy;
43514350

4352-
vEraseQueue.push_back(orphanHash);
43534351

43544352
if (setMisbehaving.count(fromPeer))
43554353
continue;
@@ -4358,6 +4356,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
43584356
LogPrint("mempool", " accepted orphan tx %s\n", orphanHash.ToString());
43594357
RelayTransaction(orphanTx);
43604358
vWorkQueue.push_back(orphanHash);
4359+
vEraseQueue.push_back(orphanHash);
43614360
}
43624361
else if (!fMissingInputs2)
43634362
{
@@ -4369,8 +4368,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
43694368
setMisbehaving.insert(fromPeer);
43704369
LogPrint("mempool", " invalid orphan tx %s\n", orphanHash.ToString());
43714370
}
4372-
// too-little-fee orphan
4371+
// Has inputs but not accepted to mempool
4372+
// Probably non-standard or insufficient fee/priority
43734373
LogPrint("mempool", " removed orphan tx %s\n", orphanHash.ToString());
4374+
vEraseQueue.push_back(orphanHash);
43744375
}
43754376
mempool.check(pcoinsTip);
43764377
}

0 commit comments

Comments
 (0)