net_processing: move the debug log about receiving VERSION earlier
Move the debug log message that we have received a `VERSION` message earlier, before any `MakeAndPushMessage()`. Thus, if the processing is interrupted before `MakeAndPushMessage()`s, the log would still be executed.
This commit is contained in:
1 file changed
+6
-6
@@ -3567,6 +3567,12 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||||||
if (fRelay) pfrom.m_relays_txs = true;
|
if (fRelay) pfrom.m_relays_txs = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto mapped_as{m_connman.GetMappedAS(pfrom.addr)};
|
||||||
|
LogDebug(BCLog::NET, "receive version message: %s: version %d, blocks=%d, us=%s, txrelay=%d, peer=%d%s%s\n",
|
||||||
|
cleanSubVer, pfrom.nVersion,
|
||||||
|
peer->m_starting_height, addrMe.ToStringAddrPort(), fRelay, pfrom.GetId(),
|
||||||
|
pfrom.LogIP(fLogIPs), (mapped_as ? strprintf(", mapped_as=%d", mapped_as) : ""));
|
||||||
|
|
||||||
if (greatest_common_version >= WTXID_RELAY_VERSION) {
|
if (greatest_common_version >= WTXID_RELAY_VERSION) {
|
||||||
MakeAndPushMessage(pfrom, NetMsgType::WTXIDRELAY);
|
MakeAndPushMessage(pfrom, NetMsgType::WTXIDRELAY);
|
||||||
}
|
}
|
||||||
@@ -3645,12 +3651,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||||||
m_addrman.Good(pfrom.addr);
|
m_addrman.Good(pfrom.addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto mapped_as{m_connman.GetMappedAS(pfrom.addr)};
|
|
||||||
LogDebug(BCLog::NET, "receive version message: %s: version %d, blocks=%d, us=%s, txrelay=%d, peer=%d%s%s\n",
|
|
||||||
cleanSubVer, pfrom.nVersion,
|
|
||||||
peer->m_starting_height, addrMe.ToStringAddrPort(), fRelay, pfrom.GetId(),
|
|
||||||
pfrom.LogIP(fLogIPs), (mapped_as ? strprintf(", mapped_as=%d", mapped_as) : ""));
|
|
||||||
|
|
||||||
peer->m_time_offset = NodeSeconds{std::chrono::seconds{nTime}} - Now<NodeSeconds>();
|
peer->m_time_offset = NodeSeconds{std::chrono::seconds{nTime}} - Now<NodeSeconds>();
|
||||||
if (!pfrom.IsInboundConn()) {
|
if (!pfrom.IsInboundConn()) {
|
||||||
// Don't use timedata samples from inbound peers to make it
|
// Don't use timedata samples from inbound peers to make it
|
||||||
|
|||||||
Reference in new issue
Block a user