@@ -470,7 +470,7 @@ class PeerManagerImpl final : public PeerManager
470
470
*
471
471
* Memory used: 1.3 MB
472
472
*/
473
- CRollingBloomFilter recentRejects GUARDED_BY (::cs_main){120'000 , 0.000'001 };
473
+ CRollingBloomFilter m_recent_rejects GUARDED_BY (::cs_main){120'000 , 0.000'001 };
474
474
uint256 hashRecentRejectsChainTip GUARDED_BY (cs_main);
475
475
476
476
/*
@@ -1604,7 +1604,7 @@ bool PeerManagerImpl::AlreadyHaveTx(const GenTxid& gtxid)
1604
1604
// or a double-spend. Reset the rejects filter and give those
1605
1605
// txs a second chance.
1606
1606
hashRecentRejectsChainTip = m_chainman.ActiveChain ().Tip ()->GetBlockHash ();
1607
- recentRejects .reset ();
1607
+ m_recent_rejects .reset ();
1608
1608
}
1609
1609
1610
1610
const uint256& hash = gtxid.GetHash ();
@@ -1616,7 +1616,7 @@ bool PeerManagerImpl::AlreadyHaveTx(const GenTxid& gtxid)
1616
1616
if (m_recent_confirmed_transactions->contains (hash)) return true ;
1617
1617
}
1618
1618
1619
- return recentRejects .contains (hash) || m_mempool.exists (gtxid);
1619
+ return m_recent_rejects .contains (hash) || m_mempool.exists (gtxid);
1620
1620
}
1621
1621
1622
1622
bool PeerManagerImpl::AlreadyHaveBlock (const uint256& block_hash)
@@ -2235,7 +2235,7 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set)
2235
2235
// See also comments in https://github.com/bitcoin/bitcoin/pull/18044#discussion_r443419034
2236
2236
// for concerns around weakening security of unupgraded nodes
2237
2237
// if we start doing this too early.
2238
- recentRejects .insert (porphanTx->GetWitnessHash ());
2238
+ m_recent_rejects .insert (porphanTx->GetWitnessHash ());
2239
2239
// If the transaction failed for TX_INPUTS_NOT_STANDARD,
2240
2240
// then we know that the witness was irrelevant to the policy
2241
2241
// failure, since this check depends only on the txid
@@ -2247,7 +2247,7 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set)
2247
2247
if (state.GetResult () == TxValidationResult::TX_INPUTS_NOT_STANDARD && porphanTx->GetWitnessHash () != porphanTx->GetHash ()) {
2248
2248
// We only add the txid if it differs from the wtxid, to
2249
2249
// avoid wasting entries in the rolling bloom filter.
2250
- recentRejects .insert (porphanTx->GetHash ());
2250
+ m_recent_rejects .insert (porphanTx->GetHash ());
2251
2251
}
2252
2252
}
2253
2253
m_orphanage.EraseTx (orphanHash);
@@ -3250,7 +3250,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3250
3250
std::sort (unique_parents.begin (), unique_parents.end ());
3251
3251
unique_parents.erase (std::unique (unique_parents.begin (), unique_parents.end ()), unique_parents.end ());
3252
3252
for (const uint256& parent_txid : unique_parents) {
3253
- if (recentRejects .contains (parent_txid)) {
3253
+ if (m_recent_rejects .contains (parent_txid)) {
3254
3254
fRejectedParents = true ;
3255
3255
break ;
3256
3256
}
@@ -3291,8 +3291,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3291
3291
// regardless of what witness is provided, we will not accept
3292
3292
// this, so we don't need to allow for redownload of this txid
3293
3293
// from any of our non-wtxidrelay peers.
3294
- recentRejects .insert (tx.GetHash ());
3295
- recentRejects .insert (tx.GetWitnessHash ());
3294
+ m_recent_rejects .insert (tx.GetHash ());
3295
+ m_recent_rejects .insert (tx.GetWitnessHash ());
3296
3296
m_txrequest.ForgetTxHash (tx.GetHash ());
3297
3297
m_txrequest.ForgetTxHash (tx.GetWitnessHash ());
3298
3298
}
@@ -3311,7 +3311,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3311
3311
// See also comments in https://github.com/bitcoin/bitcoin/pull/18044#discussion_r443419034
3312
3312
// for concerns around weakening security of unupgraded nodes
3313
3313
// if we start doing this too early.
3314
- recentRejects .insert (tx.GetWitnessHash ());
3314
+ m_recent_rejects .insert (tx.GetWitnessHash ());
3315
3315
m_txrequest.ForgetTxHash (tx.GetWitnessHash ());
3316
3316
// If the transaction failed for TX_INPUTS_NOT_STANDARD,
3317
3317
// then we know that the witness was irrelevant to the policy
@@ -3322,7 +3322,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3322
3322
// transactions are later received (resulting in
3323
3323
// parent-fetching by txid via the orphan-handling logic).
3324
3324
if (state.GetResult () == TxValidationResult::TX_INPUTS_NOT_STANDARD && tx.GetWitnessHash () != tx.GetHash ()) {
3325
- recentRejects .insert (tx.GetHash ());
3325
+ m_recent_rejects .insert (tx.GetHash ());
3326
3326
m_txrequest.ForgetTxHash (tx.GetHash ());
3327
3327
}
3328
3328
if (RecursiveDynamicUsage (*ptx) < 100000 ) {
@@ -3331,21 +3331,21 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3331
3331
}
3332
3332
}
3333
3333
3334
- // If a tx has been detected by recentRejects , we will have reached
3334
+ // If a tx has been detected by m_recent_rejects , we will have reached
3335
3335
// this point and the tx will have been ignored. Because we haven't run
3336
3336
// the tx through AcceptToMemoryPool, we won't have computed a DoS
3337
3337
// score for it or determined exactly why we consider it invalid.
3338
3338
//
3339
3339
// This means we won't penalize any peer subsequently relaying a DoSy
3340
3340
// tx (even if we penalized the first peer who gave it to us) because
3341
- // we have to account for recentRejects showing false positives. In
3341
+ // we have to account for m_recent_rejects showing false positives. In
3342
3342
// other words, we shouldn't penalize a peer if we aren't *sure* they
3343
3343
// submitted a DoSy tx.
3344
3344
//
3345
- // Note that recentRejects doesn't just record DoSy or invalid
3345
+ // Note that m_recent_rejects doesn't just record DoSy or invalid
3346
3346
// transactions, but any tx not accepted by the mempool, which may be
3347
3347
// due to node policy (vs. consensus). So we can't blanket penalize a
3348
- // peer simply for relaying a tx that our recentRejects has caught,
3348
+ // peer simply for relaying a tx that our m_recent_rejects has caught,
3349
3349
// regardless of false positives.
3350
3350
3351
3351
if (state.IsInvalid ()) {
0 commit comments