mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-20 14:05:23 +01:00
Update getpeerinfo/-netinfo/TxRelay#m_relay_txs relaytxes docs (for v24 backport)
to the current p2p behavior. We only initialize the Peer::TxRelay m_relay_txs data structure if it isn't an outbound block-relay-only connection and fRelay=true (the peer wishes to receive tx announcements) or we're offering NODE_BLOOM to this peer.
This commit is contained in:
parent
1f448542e7
commit
df660ddb1c
3 changed files with 8 additions and 12 deletions
|
@ -642,7 +642,7 @@ public:
|
|||
" send Time since last message sent to the peer, in seconds\n"
|
||||
" recv Time since last message received from the peer, in seconds\n"
|
||||
" txn Time since last novel transaction received from the peer and accepted into our mempool, in minutes\n"
|
||||
" \"*\" - the peer requested we not relay transactions to it (relaytxes is false)\n"
|
||||
" \"*\" - whether we relay transactions to this peer (relaytxes is false)\n"
|
||||
" blk Time since last novel block passing initial validity checks received from the peer, in minutes\n"
|
||||
" hb High-bandwidth BIP152 compact block relay\n"
|
||||
" \".\" (to) - we selected the peer as a high-bandwidth peer\n"
|
||||
|
|
|
@ -271,12 +271,7 @@ struct Peer {
|
|||
|
||||
struct TxRelay {
|
||||
mutable RecursiveMutex m_bloom_filter_mutex;
|
||||
/** Whether the peer wishes to receive transaction announcements.
|
||||
*
|
||||
* This is initially set based on the fRelay flag in the received
|
||||
* `version` message. If initially set to false, it can only be flipped
|
||||
* to true if we have offered the peer NODE_BLOOM services and it sends
|
||||
* us a `filterload` or `filterclear` message. See BIP37. */
|
||||
/** Whether we relay transactions to this peer. */
|
||||
bool m_relay_txs GUARDED_BY(m_bloom_filter_mutex){false};
|
||||
/** A bloom filter for which transactions to announce to the peer. See BIP37. */
|
||||
std::unique_ptr<CBloomFilter> m_bloom_filter PT_GUARDED_BY(m_bloom_filter_mutex) GUARDED_BY(m_bloom_filter_mutex){nullptr};
|
||||
|
@ -3247,10 +3242,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||
}
|
||||
peer->m_starting_height = starting_height;
|
||||
|
||||
// We only initialize the m_tx_relay data structure if:
|
||||
// - this isn't an outbound block-relay-only 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)
|
||||
// We only initialize the Peer::TxRelay m_relay_txs data structure if:
|
||||
// - this isn't an outbound block-relay-only connection, and
|
||||
// - fRelay=true (the peer wishes to receive transaction announcements)
|
||||
// or we're offering NODE_BLOOM to this peer. NODE_BLOOM means that
|
||||
// the peer may turn on transaction relay later.
|
||||
if (!pfrom.IsBlockOnlyConn() &&
|
||||
(fRelay || (peer->m_our_services & NODE_BLOOM))) {
|
||||
auto* const tx_relay = peer->SetTxRelay();
|
||||
|
|
|
@ -114,7 +114,7 @@ static RPCHelpMan getpeerinfo()
|
|||
{
|
||||
{RPCResult::Type::STR, "SERVICE_NAME", "the service name if it is recognised"}
|
||||
}},
|
||||
{RPCResult::Type::BOOL, "relaytxes", /*optional=*/true, "Whether peer has asked us to relay transactions to it"},
|
||||
{RPCResult::Type::BOOL, "relaytxes", /*optional=*/true, "Whether we relay transactions to this peer"},
|
||||
{RPCResult::Type::NUM_TIME, "lastsend", "The " + UNIX_EPOCH_TIME + " of the last send"},
|
||||
{RPCResult::Type::NUM_TIME, "lastrecv", "The " + UNIX_EPOCH_TIME + " of the last receive"},
|
||||
{RPCResult::Type::NUM_TIME, "last_transaction", "The " + UNIX_EPOCH_TIME + " of the last valid transaction received from this peer"},
|
||||
|
|
Loading…
Add table
Reference in a new issue