Skip to content

Commit 48c8a9b

Browse files
committed
net_processing: log txrelay flag from version message
1 parent 98fab37 commit 48c8a9b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/net_processing.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -880,13 +880,14 @@ void PeerManagerImpl::PushNodeVersion(CNode& pnode, int64_t nTime)
880880
CAddress(CService(), addr.nServices);
881881
CAddress addrMe = CAddress(CService(), nLocalNodeServices);
882882

883+
const bool tx_relay = !m_ignore_incoming_txs && pnode.m_tx_relay != nullptr;
883884
m_connman.PushMessage(&pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, (uint64_t)nLocalNodeServices, nTime, addrYou, addrMe,
884-
nonce, strSubVersion, nNodeStartingHeight, !m_ignore_incoming_txs && pnode.m_tx_relay != nullptr));
885+
nonce, strSubVersion, nNodeStartingHeight, tx_relay));
885886

886887
if (fLogIPs) {
887-
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), nodeid);
888+
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, txrelay=%d, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), tx_relay, nodeid);
888889
} else {
889-
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), nodeid);
890+
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, txrelay=%d, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), tx_relay, nodeid);
890891
}
891892
}
892893

@@ -2642,9 +2643,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
26422643
if (fLogIPs)
26432644
remoteAddr = ", peeraddr=" + pfrom.addr.ToString();
26442645

2645-
LogPrint(BCLog::NET, "receive version message: %s: version %d, blocks=%d, us=%s, peer=%d%s\n",
2646+
LogPrint(BCLog::NET, "receive version message: %s: version %d, blocks=%d, us=%s, txrelay=%d, peer=%d%s\n",
26462647
cleanSubVer, pfrom.nVersion,
2647-
peer->m_starting_height, addrMe.ToString(), pfrom.GetId(),
2648+
peer->m_starting_height, addrMe.ToString(), fRelay, pfrom.GetId(),
26482649
remoteAddr);
26492650

26502651
int64_t nTimeOffset = nTime - GetTime();

0 commit comments

Comments
 (0)