mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
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.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user