mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-21 13:10:08 +01:00
refactor: s/command/msg_type/ in CNetMsgMaker and CSerializedNetMsg
This commit is contained in:
@@ -723,7 +723,7 @@ void V1TransportSerializer::prepareForTransport(CSerializedNetMsg& msg, std::vec
|
||||
uint256 hash = Hash(msg.data.begin(), msg.data.end());
|
||||
|
||||
// create header
|
||||
CMessageHeader hdr(Params().MessageStart(), msg.command.c_str(), msg.data.size());
|
||||
CMessageHeader hdr(Params().MessageStart(), msg.m_type.c_str(), msg.data.size());
|
||||
memcpy(hdr.pchChecksum, hash.begin(), CMessageHeader::CHECKSUM_SIZE);
|
||||
|
||||
// serialize header
|
||||
@@ -2736,7 +2736,7 @@ bool CConnman::NodeFullyConnected(const CNode* pnode)
|
||||
void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
|
||||
{
|
||||
size_t nMessageSize = msg.data.size();
|
||||
LogPrint(BCLog::NET, "sending %s (%d bytes) peer=%d\n", SanitizeString(msg.command), nMessageSize, pnode->GetId());
|
||||
LogPrint(BCLog::NET, "sending %s (%d bytes) peer=%d\n", SanitizeString(msg.m_type), nMessageSize, pnode->GetId());
|
||||
|
||||
// make sure we use the appropriate network transport format
|
||||
std::vector<unsigned char> serializedHeader;
|
||||
@@ -2748,8 +2748,8 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
|
||||
LOCK(pnode->cs_vSend);
|
||||
bool optimisticSend(pnode->vSendMsg.empty());
|
||||
|
||||
//log total amount of bytes per command
|
||||
pnode->mapSendBytesPerMsgCmd[msg.command] += nTotalSize;
|
||||
//log total amount of bytes per message type
|
||||
pnode->mapSendBytesPerMsgCmd[msg.m_type] += nTotalSize;
|
||||
pnode->nSendSize += nTotalSize;
|
||||
|
||||
if (pnode->nSendSize > nSendBufferMaxSize)
|
||||
|
||||
Reference in New Issue
Block a user