mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
partial bitcoin#26396: Avoid SetTxRelay for feeler connections
excludes: - fa24239a (changes to `p2p_sendtxrcncl.py`)
This commit is contained in:
parent
221a78ea84
commit
6a37934af4
@ -929,10 +929,8 @@ public:
|
|||||||
/** Whether this peer provides all services that we want. Used for eviction decisions */
|
/** Whether this peer provides all services that we want. Used for eviction decisions */
|
||||||
std::atomic_bool m_has_all_wanted_services{false};
|
std::atomic_bool m_has_all_wanted_services{false};
|
||||||
|
|
||||||
/** Whether we should relay transactions to this peer (their version
|
/** Whether we should relay transactions to this peer. This only changes
|
||||||
* message did not include fRelay=false and this is not a block-relay-only
|
* from false to true. It will never change back to false. */
|
||||||
* connection). This only changes from false to true. It will never change
|
|
||||||
* back to false. Used only in inbound eviction logic. */
|
|
||||||
std::atomic_bool m_relays_txs{false};
|
std::atomic_bool m_relays_txs{false};
|
||||||
|
|
||||||
/** Whether this peer has loaded a bloom filter. Used only in inbound
|
/** Whether this peer has loaded a bloom filter. Used only in inbound
|
||||||
|
@ -399,9 +399,7 @@ private:
|
|||||||
Mutex m_tx_relay_mutex;
|
Mutex m_tx_relay_mutex;
|
||||||
|
|
||||||
/** Transaction relay data.
|
/** Transaction relay data.
|
||||||
* (Bitcoin) Will be a nullptr if we're not relaying transactions with this peer
|
* (Bitcoin) Transaction relay data. May be a nullptr.
|
||||||
* (e.g. if it's a block-relay-only peer). Users should access this with
|
|
||||||
* the GetTxRelay() getter.
|
|
||||||
* (Dash) Always initialized but selectively available through GetTxRelay()
|
* (Dash) Always initialized but selectively available through GetTxRelay()
|
||||||
* (non-transaction relay should use GetInvRelay(), which will provide
|
* (non-transaction relay should use GetInvRelay(), which will provide
|
||||||
* unconditional access) */
|
* unconditional access) */
|
||||||
@ -3523,9 +3521,11 @@ void PeerManagerImpl::ProcessMessage(
|
|||||||
|
|
||||||
// We only initialize the m_tx_relay data structure if:
|
// We only initialize the m_tx_relay data structure if:
|
||||||
// - this isn't an outbound block-relay-only connection; and
|
// - this isn't an outbound block-relay-only connection; and
|
||||||
|
// - this isn't an outbound feeler connection, and
|
||||||
// - fRelay=true or we're offering NODE_BLOOM to this peer
|
// - fRelay=true or we're offering NODE_BLOOM to this peer
|
||||||
// (NODE_BLOOM means that the peer may turn on tx relay later)
|
// (NODE_BLOOM means that the peer may turn on tx relay later)
|
||||||
if (!pfrom.IsBlockOnlyConn() &&
|
if (!pfrom.IsBlockOnlyConn() &&
|
||||||
|
!pfrom.IsFeelerConn() &&
|
||||||
(fRelay || (peer->m_our_services & NODE_BLOOM))) {
|
(fRelay || (peer->m_our_services & NODE_BLOOM))) {
|
||||||
auto* const tx_relay = peer->SetTxRelay();
|
auto* const tx_relay = peer->SetTxRelay();
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user