Skip to content

Commit 92e72b5

Browse files
dergoeggestickies-v
authored andcommitted
[net processing] Move IgnoresIncomingTxs to PeerManagerInfo
1 parent 7d9c3ec commit 92e72b5

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ class PeerManagerImpl final : public PeerManager
519519
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
520520
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
521521
PeerManagerInfo GetInfo() const override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
522-
bool IgnoresIncomingTxs() override { return m_opts.ignore_incoming_txs; }
523522
void SendPings() override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
524523
void RelayTransaction(const uint256& txid, const uint256& wtxid) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
525524
void SetBestBlock(int height, std::chrono::seconds time) override
@@ -1809,6 +1808,7 @@ PeerManagerInfo PeerManagerImpl::GetInfo() const
18091808
{
18101809
return PeerManagerInfo{
18111810
.median_outbound_time_offset = m_outbound_time_offsets.Median(),
1811+
.ignores_incoming_txs = m_opts.ignore_incoming_txs,
18121812
};
18131813
}
18141814

src/net_processing.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct CNodeStateStats {
4848

4949
struct PeerManagerInfo {
5050
std::chrono::seconds median_outbound_time_offset{0s};
51+
bool ignores_incoming_txs{false};
5152
};
5253

5354
class PeerManager : public CValidationInterface, public NetEventsInterface
@@ -93,9 +94,6 @@ class PeerManager : public CValidationInterface, public NetEventsInterface
9394
/** Get peer manager info. */
9495
virtual PeerManagerInfo GetInfo() const = 0;
9596

96-
/** Whether this node ignores txs received over p2p. */
97-
virtual bool IgnoresIncomingTxs() = 0;
98-
9997
/** Relay transaction to all peers. */
10098
virtual void RelayTransaction(const uint256& txid, const uint256& wtxid) = 0;
10199

src/rpc/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ static RPCHelpMan getnetworkinfo()
679679
}
680680
if (node.peerman) {
681681
auto peerman_info{node.peerman->GetInfo()};
682-
obj.pushKV("localrelay", !node.peerman->IgnoresIncomingTxs());
682+
obj.pushKV("localrelay", !peerman_info.ignores_incoming_txs);
683683
obj.pushKV("timeoffset", Ticks<std::chrono::seconds>(peerman_info.median_outbound_time_offset));
684684
}
685685
if (node.connman) {

0 commit comments

Comments
 (0)