mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32: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 */
|
||||
std::atomic_bool m_has_all_wanted_services{false};
|
||||
|
||||
/** Whether we should relay transactions to this peer (their version
|
||||
* message did not include fRelay=false and this is not a block-relay-only
|
||||
* connection). This only changes from false to true. It will never change
|
||||
* back to false. Used only in inbound eviction logic. */
|
||||
/** Whether we should relay transactions to this peer. This only changes
|
||||
* from false to true. It will never change back to false. */
|
||||
std::atomic_bool m_relays_txs{false};
|
||||
|
||||
/** Whether this peer has loaded a bloom filter. Used only in inbound
|
||||
|
@ -399,9 +399,7 @@ private:
|
||||
Mutex m_tx_relay_mutex;
|
||||
|
||||
/** Transaction relay data.
|
||||
* (Bitcoin) Will be a nullptr if we're not relaying transactions with this peer
|
||||
* (e.g. if it's a block-relay-only peer). Users should access this with
|
||||
* the GetTxRelay() getter.
|
||||
* (Bitcoin) Transaction relay data. May be a nullptr.
|
||||
* (Dash) Always initialized but selectively available through GetTxRelay()
|
||||
* (non-transaction relay should use GetInvRelay(), which will provide
|
||||
* unconditional access) */
|
||||
@ -3523,9 +3521,11 @@ void PeerManagerImpl::ProcessMessage(
|
||||
|
||||
// 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 feeler connection, and
|
||||
// - fRelay=true or we're offering NODE_BLOOM to this peer
|
||||
// (NODE_BLOOM means that the peer may turn on tx relay later)
|
||||
if (!pfrom.IsBlockOnlyConn() &&
|
||||
!pfrom.IsFeelerConn() &&
|
||||
(fRelay || (peer->m_our_services & NODE_BLOOM))) {
|
||||
auto* const tx_relay = peer->SetTxRelay();
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user