Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 3,129 Lines • ▼ Show 20 Lines | bool ProcessMessages(const Config &config, CNode *pfrom, CConnman &connman, | ||||
} | } | ||||
CNetMessage &msg(msgs.front()); | CNetMessage &msg(msgs.front()); | ||||
msg.SetVersion(pfrom->GetRecvVersion()); | msg.SetVersion(pfrom->GetRecvVersion()); | ||||
// This is a new peer. Before doing anything, we need to detect what magic | // This is a new peer. Before doing anything, we need to detect what magic | ||||
// the peer is using. | // the peer is using. | ||||
if (pfrom->nVersion == 0 && | if (pfrom->nVersion == 0 && | ||||
memcmp(msg.hdr.pchMessageStart, chainparams.MessageStart(), | memcmp(msg.hdr.pchMessageStart, chainparams.DiskMagic(), | ||||
CMessageHeader::MESSAGE_START_SIZE) == 0) { | CMessageHeader::MESSAGE_START_SIZE) == 0) { | ||||
pfrom->fUsesCashMagic = false; | pfrom->fUsesCashMagic = false; | ||||
} | } | ||||
// Scan for message start | // Scan for message start | ||||
if (memcmp(msg.hdr.pchMessageStart, pfrom->GetMagic(chainparams), | if (memcmp(msg.hdr.pchMessageStart, pfrom->GetMagic(chainparams), | ||||
CMessageHeader::MESSAGE_START_SIZE) != 0) { | CMessageHeader::MESSAGE_START_SIZE) != 0) { | ||||
LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n", | LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\n", | ||||
▲ Show 20 Lines • Show All 704 Lines • Show Last 20 Lines |