aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorTroy Giorshev <[email protected]>2020-06-29 14:09:42 -0400
committerTroy Giorshev <[email protected]>2020-09-22 22:01:14 -0400
commit2716647ebf60cea05fc9edce6a18dcce4e7727ad (patch)
tree95aeccb07b675773b935be187721b21d62219639 /src/net.cpp
parentMerge #19963: Clarify blocksonly whitelistforcerelay test (diff)
downloaddiscoin-2716647ebf60cea05fc9edce6a18dcce4e7727ad.tar.xz
discoin-2716647ebf60cea05fc9edce6a18dcce4e7727ad.zip
Give V1TransportDeserializer an m_node_id member
This is intended to only be used for logging. This will allow log messages in the following commits to keep recording the peer's ID, even when logging is moved into V1TransportDeserializer.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp
index e7d3a146f..73029655c 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -699,10 +699,11 @@ CNetMessage V1TransportDeserializer::GetMessage(const CMessageHeader::MessageSta
msg.m_valid_checksum = (memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) == 0);
if (!msg.m_valid_checksum) {
- LogPrint(BCLog::NET, "CHECKSUM ERROR (%s, %u bytes), expected %s was %s\n",
+ LogPrint(BCLog::NET, "CHECKSUM ERROR (%s, %u bytes), expected %s was %s, peer=%d\n",
SanitizeString(msg.m_command), msg.m_message_size,
HexStr(Span<uint8_t>(hash.begin(), hash.begin() + CMessageHeader::CHECKSUM_SIZE)),
- HexStr(hdr.pchChecksum));
+ HexStr(hdr.pchChecksum),
+ m_node_id);
}
// store receive time
@@ -2828,7 +2829,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
LogPrint(BCLog::NET, "Added connection peer=%d\n", id);
}
- m_deserializer = MakeUnique<V1TransportDeserializer>(V1TransportDeserializer(Params().MessageStart(), SER_NETWORK, INIT_PROTO_VERSION));
+ m_deserializer = MakeUnique<V1TransportDeserializer>(V1TransportDeserializer(Params().MessageStart(), GetId(), SER_NETWORK, INIT_PROTO_VERSION));
m_serializer = MakeUnique<V1TransportSerializer>(V1TransportSerializer());
}