diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-09-29 12:39:05 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-10-12 12:14:53 -0700 |
commit | cc16fff3e476a9378d2176b3c1b83ad12b1b052a (patch) | |
tree | 1492eca5f021402661ec91c04360f4046cdc0b7d /src/net_processing.cpp | |
parent | 173a1d2d3f824b83777ac713e89bee69fd87692d (diff) |
Make txid delay penalty also apply to fetches of orphan's parents
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 14507aa920..35c87127ae 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -767,13 +767,13 @@ void PeerManager::AddTxAnnouncement(const CNode& node, const GenTxid& gtxid, std // - "preferred": if fPreferredDownload is set (= outbound, or PF_NOBAN permission) // - "reqtime": current time plus delays for: // - NONPREF_PEER_TX_DELAY for announcements from non-preferred connections - // - TXID_RELAY_DELAY for announcements from txid peers while wtxid peers are available + // - TXID_RELAY_DELAY for txid announcements while wtxid peers are available // - OVERLOADED_PEER_TX_DELAY for announcements from peers which have at least // MAX_PEER_TX_REQUEST_IN_FLIGHT requests in flight (and don't have PF_RELAY). auto delay = std::chrono::microseconds{0}; const bool preferred = state->fPreferredDownload; if (!preferred) delay += NONPREF_PEER_TX_DELAY; - if (!state->m_wtxid_relay && g_wtxid_relay_peers > 0) delay += TXID_RELAY_DELAY; + if (!gtxid.IsWtxid() && g_wtxid_relay_peers > 0) delay += TXID_RELAY_DELAY; const bool overloaded = !node.HasPermission(PF_RELAY) && m_txrequest.CountInFlight(nodeid) >= MAX_PEER_TX_REQUEST_IN_FLIGHT; if (overloaded) delay += OVERLOADED_PEER_TX_DELAY; |