@@ -515,7 +515,7 @@ class PeerManagerImpl final : public PeerManager
515
515
std::optional<std::string> FetchBlock (NodeId peer_id, const CBlockIndex& block_index) override
516
516
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
517
517
bool GetNodeStateStats (NodeId nodeid, CNodeStateStats& stats) const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
518
- bool IgnoresIncomingTxs () override { return m_ignore_incoming_txs ; }
518
+ bool IgnoresIncomingTxs () override { return m_opts. ignore_incoming_txs ; }
519
519
void SendPings () override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
520
520
void RelayTransaction (const uint256& txid, const uint256& wtxid) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
521
521
void SetBestHeight (int height) override { m_best_height = height; };
@@ -718,9 +718,6 @@ class PeerManagerImpl final : public PeerManager
718
718
/* * Next time to check for stale tip */
719
719
std::chrono::seconds m_stale_tip_check_time GUARDED_BY (cs_main){0s};
720
720
721
- /* * Whether this node is running in -blocksonly mode */
722
- const bool m_ignore_incoming_txs;
723
-
724
721
const Options m_opts;
725
722
726
723
bool RejectIncomingTxs (const CNode& peer) const ;
@@ -1214,7 +1211,7 @@ void PeerManagerImpl::MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid)
1214
1211
// When in -blocksonly mode, never request high-bandwidth mode from peers. Our
1215
1212
// mempool will not contain the transactions necessary to reconstruct the
1216
1213
// compact block.
1217
- if (m_ignore_incoming_txs ) return ;
1214
+ if (m_opts. ignore_incoming_txs ) return ;
1218
1215
1219
1216
CNodeState* nodestate = State (nodeid);
1220
1217
if (!nodestate || !nodestate->m_provides_cmpctblocks ) {
@@ -1825,7 +1822,6 @@ PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
1825
1822
m_banman(banman),
1826
1823
m_chainman(chainman),
1827
1824
m_mempool(pool),
1828
- m_ignore_incoming_txs(opts.ignore_incoming_txs),
1829
1825
m_opts{opts}
1830
1826
{
1831
1827
// While Erlay support is incomplete, it must be enabled explicitly via -txreconciliation.
@@ -2732,7 +2728,7 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c
2732
2728
last_header.nHeight );
2733
2729
}
2734
2730
if (vGetData.size () > 0 ) {
2735
- if (!m_ignore_incoming_txs &&
2731
+ if (!m_opts. ignore_incoming_txs &&
2736
2732
nodestate->m_provides_cmpctblocks &&
2737
2733
vGetData.size () == 1 &&
2738
2734
mapBlocksInFlight.size () == 1 &&
@@ -3437,7 +3433,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3437
3433
// - we are not in -blocksonly mode.
3438
3434
const auto * tx_relay = peer->GetTxRelay ();
3439
3435
if (tx_relay && WITH_LOCK (tx_relay->m_bloom_filter_mutex , return tx_relay->m_relay_txs ) &&
3440
- !pfrom.IsAddrFetchConn () && !m_ignore_incoming_txs ) {
3436
+ !pfrom.IsAddrFetchConn () && !m_opts. ignore_incoming_txs ) {
3441
3437
const uint64_t recon_salt = m_txreconciliation->PreRegisterPeer (pfrom.GetId ());
3442
3438
m_connman.PushMessage (&pfrom, msg_maker.Make (NetMsgType::SENDTXRCNCL,
3443
3439
TXRECONCILIATION_VERSION, recon_salt));
@@ -5361,7 +5357,7 @@ void PeerManagerImpl::MaybeSendSendHeaders(CNode& node, Peer& peer)
5361
5357
5362
5358
void PeerManagerImpl::MaybeSendFeefilter (CNode& pto, Peer& peer, std::chrono::microseconds current_time)
5363
5359
{
5364
- if (m_ignore_incoming_txs ) return ;
5360
+ if (m_opts. ignore_incoming_txs ) return ;
5365
5361
if (pto.GetCommonVersion () < FEEFILTER_VERSION) return ;
5366
5362
// peers with the forcerelay permission should not filter txs to us
5367
5363
if (pto.HasPermission (NetPermissionFlags::ForceRelay)) return ;
@@ -5429,7 +5425,7 @@ bool PeerManagerImpl::RejectIncomingTxs(const CNode& peer) const
5429
5425
if (peer.IsBlockOnlyConn ()) return true ;
5430
5426
if (peer.IsFeelerConn ()) return true ;
5431
5427
// In -blocksonly mode, peers need the 'relay' permission to send txs to us
5432
- if (m_ignore_incoming_txs && !peer.HasPermission (NetPermissionFlags::Relay)) return true ;
5428
+ if (m_opts. ignore_incoming_txs && !peer.HasPermission (NetPermissionFlags::Relay)) return true ;
5433
5429
return false ;
5434
5430
}
5435
5431
0 commit comments