Skip to content

Commit 9ad211c

Browse files
committed
[doc] more detailed explanation for deduplication
1 parent 83d4fb7 commit 9ad211c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/validation.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,10 +1250,14 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptPackage(const Package& package,
12501250

12511251
LOCK(m_pool.cs);
12521252
std::map<const uint256, const MempoolAcceptResult> results;
1253-
// As node operators are free to set their mempool policies however they please, it's possible
1254-
// for package transaction(s) to already be in the mempool, and we don't want to reject the
1255-
// entire package in that case (as that could be a censorship vector). Filter the transactions
1256-
// that are already in mempool and add their information to results, since we already have them.
1253+
// Node operators are free to set their mempool policies however they please, nodes may receive
1254+
// transactions in different orders, and malicious counterparties may try to take advantage of
1255+
// policy differences to pin or delay propagation of transactions. As such, it's possible for
1256+
// some package transaction(s) to already be in the mempool, and we don't want to reject the
1257+
// entire package in that case (as that could be a censorship vector). De-duplicate the
1258+
// transactions that are already in the mempool, and only call AcceptMultipleTransactions() with
1259+
// the new transactions. This ensures we don't double-count transaction counts and sizes when
1260+
// checking ancestor/descendant limits, or double-count transaction fees for fee-related policy.
12571261
std::vector<CTransactionRef> txns_new;
12581262
for (const auto& tx : package) {
12591263
const auto& wtxid = tx->GetWitnessHash();

0 commit comments

Comments
 (0)