@@ -3296,11 +3296,13 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3296
3296
if (greatest_common_version >= WTXID_RELAY_VERSION && m_txreconciliation) {
3297
3297
// Per BIP-330, we announce txreconciliation support if:
3298
3298
// - protocol version per the peer's VERSION message supports WTXID_RELAY;
3299
- // - transaction relay is supported per the peer's VERSION message (see m_relays_txs);
3300
- // - this is not a block-relay-only connection and not a feeler (see m_relays_txs);
3299
+ // - transaction relay is supported per the peer's VERSION message
3300
+ // - this is not a block-relay-only connection and not a feeler
3301
3301
// - this is not an addr fetch connection;
3302
3302
// - we are not in -blocksonly mode.
3303
- if (pfrom.m_relays_txs && !pfrom.IsAddrFetchConn () && !m_ignore_incoming_txs) {
3303
+ const auto * tx_relay = peer->GetTxRelay ();
3304
+ if (tx_relay && WITH_LOCK (tx_relay->m_bloom_filter_mutex , return tx_relay->m_relay_txs ) &&
3305
+ !pfrom.IsAddrFetchConn () && !m_ignore_incoming_txs) {
3304
3306
const uint64_t recon_salt = m_txreconciliation->PreRegisterPeer (pfrom.GetId ());
3305
3307
m_connman.PushMessage (&pfrom, msg_maker.Make (NetMsgType::SENDTXRCNCL,
3306
3308
TXRECONCILIATION_VERSION, recon_salt));
@@ -3529,7 +3531,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3529
3531
// Peer must not offer us reconciliations if they specified no tx relay support in VERSION.
3530
3532
// This flag might also be false in other cases, but the RejectIncomingTxs check above
3531
3533
// eliminates them, so that this flag fully represents what we are looking for.
3532
- if (!pfrom.m_relays_txs ) {
3534
+ const auto * tx_relay = peer->GetTxRelay ();
3535
+ if (!tx_relay || !WITH_LOCK (tx_relay->m_bloom_filter_mutex , return tx_relay->m_relay_txs )) {
3533
3536
LogPrintLevel (BCLog::NET, BCLog::Level::Debug, " sendtxrcncl received from peer=%d which indicated no tx relay to us; disconnecting\n " , pfrom.GetId ());
3534
3537
pfrom.fDisconnect = true ;
3535
3538
return ;
0 commit comments