Skip to content

Commit

Permalink
review feedback - remove unesed variables and change vRecentlyAnnounc…
Browse files Browse the repository at this point in the history
…edInvs to m_recently_announced_invs
  • Loading branch information
Naviabheeman committed Sep 10, 2024
1 parent b55499d commit 6dd7081
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
static constexpr int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
/** Minimum time between orphan transactions expire time checks in seconds */
static constexpr int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60;
/** How long to cache transactions in mapRelay for normal relay */
static constexpr std::chrono::seconds RELAY_TX_CACHE_TIME = std::chrono::minutes{15};
/** How long a transaction has to be in the mempool before it can unconditionally be relayed (even when not in mapRelay). */
static constexpr std::chrono::seconds UNCONDITIONAL_RELAY_DELAY = std::chrono::minutes{2};
/** Headers download timeout expressed in microseconds
Expand Down Expand Up @@ -266,7 +264,7 @@ struct CNodeState {
bool fSupportsDesiredCmpctVersion;

//! A rolling bloom filter of all announced tx CInvs to this peer.
CRollingBloomFilter vRecentlyAnnouncedInvs = CRollingBloomFilter{INVENTORY_MAX_RECENT_RELAY, 0.000001};
CRollingBloomFilter m_recently_announced_invs = CRollingBloomFilter{INVENTORY_MAX_RECENT_RELAY, 0.000001};

/** State used to enforce CHAIN_SYNC_TIMEOUT
* Only in effect for outbound, non-manual connections, with
Expand Down Expand Up @@ -320,7 +318,7 @@ struct CNodeState {
fSupportsDesiredCmpctVersion = false;
m_chain_sync = { 0, nullptr, false, false };
m_last_block_announcement = 0;
vRecentlyAnnouncedInvs.reset();
m_recently_announced_invs.reset();
}
};

Expand Down Expand Up @@ -1302,7 +1300,7 @@ CTransactionRef static FindTxForGetData(const CNode* peer, const uint256& txid,
LOCK(cs_main);

// Otherwise, the transaction must have been announced recently.
if (State(peer->GetId())->vRecentlyAnnouncedInvs.contains(txid)) {
if (State(peer->GetId())->m_recently_announced_invs.contains(txid)) {
// If it was, it can be relayed from either the mempool...
if (txinfo.tx) return std::move(txinfo.tx);
// ... or the relay pool.
Expand Down Expand Up @@ -1357,7 +1355,7 @@ void static ProcessGetData(CNode* pfrom, CConnman* connman, const std::atomic<bo
LOCK(pfrom->cs_inventory);
if (!pfrom->filterInventoryKnown.contains(txin.prevout.hashMalFix)) {
LOCK(cs_main);
State(pfrom->GetId())->vRecentlyAnnouncedInvs.insert(txin.prevout.hashMalFix);
State(pfrom->GetId())->m_recently_announced_invs.insert(txin.prevout.hashMalFix);
}
}
}
Expand Down Expand Up @@ -3619,7 +3617,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
}
if (pto->pfilter && !pto->pfilter->IsRelevantAndUpdate(*txinfo.tx)) continue;
// Send
State(pto->GetId())->vRecentlyAnnouncedInvs.insert(hash);
State(pto->GetId())->m_recently_announced_invs.insert(hash);
vInv.push_back(CInv(MSG_TX, hash));
nRelayedTransactions++;
{
Expand Down
1 change: 0 additions & 1 deletion test/functional/test_framework/mininode.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def on_reject(self, message): pass
def on_sendcmpct(self, message): pass
def on_sendheaders(self, message): pass
def on_tx(self, message): pass
#def on_notfound(self, message): pass

def on_inv(self, message):
want = msg_getdata()
Expand Down

0 comments on commit 6dd7081

Please # to comment.