Skip to content

Commit a2fa9bb

Browse files
UdjinM6codablock
authored andcommitted
Ignore recent rejects filter for locked txes (#3124)
* Ignore recent rejects filter for locked txes If we had a conflicting tx in the mempool before the locked tx arrived and the locked one arrived before the corresponding islock (i.e. we don't really know it's the one that should be included yet), the locked one is going to be rejected due to a mempool conflict. The old tx is going to be removed from the mempool by an incoming islock a bit later, however, we won't be able to re-request the locked tx until the tip changes because of the recentRejects filter. This patch fixes it. * Add some explanation
1 parent 2ca2138 commit a2fa9bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/net_processing.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,12 @@ bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
10111011
if (mapOrphanTransactions.count(inv.hash)) return true;
10121012
}
10131013

1014-
return recentRejects->contains(inv.hash) ||
1014+
// When we receive an islock for a previously rejected transaction, we have to
1015+
// drop the first-seen tx (which such a locked transaction was conflicting with)
1016+
// and re-request the locked transaction (which did not make it into the mempool
1017+
// previously due to txn-mempool-conflict rule). This means that we must ignore
1018+
// recentRejects filter for such locked txes here.
1019+
return (recentRejects->contains(inv.hash) && !llmq::quorumInstantSendManager->IsLocked(inv.hash)) ||
10151020
mempool.exists(inv.hash) ||
10161021
pcoinsTip->HaveCoinInCache(COutPoint(inv.hash, 0)) || // Best effort: only try output 0 and 1
10171022
pcoinsTip->HaveCoinInCache(COutPoint(inv.hash, 1));

0 commit comments

Comments
 (0)