Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,305 Lines • ▼ Show 20 Lines | if (strCommand == NetMsgType::VERSION) { | ||||
pfrom->fDisconnect = true; | pfrom->fDisconnect = true; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
if (pfrom->nVersion == 0) { | if (pfrom->nVersion == 0) { | ||||
// Must have a version message before anything else | // Must have a version message before anything else | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
Misbehaving(pfrom, 1, "missing-version"); | Misbehaving(pfrom, 10, "missing-version"); | ||||
return false; | return false; | ||||
} | } | ||||
// At this point, the outgoing message serialization version can't change. | // At this point, the outgoing message serialization version can't change. | ||||
const CNetMsgMaker msgMaker(pfrom->GetSendVersion()); | const CNetMsgMaker msgMaker(pfrom->GetSendVersion()); | ||||
if (strCommand == NetMsgType::VERACK) { | if (strCommand == NetMsgType::VERACK) { | ||||
pfrom->SetRecvVersion( | pfrom->SetRecvVersion( | ||||
Show All 32 Lines | if (strCommand == NetMsgType::VERACK) { | ||||
} | } | ||||
pfrom->fSuccessfullyConnected = true; | pfrom->fSuccessfullyConnected = true; | ||||
return true; | return true; | ||||
} | } | ||||
if (!pfrom->fSuccessfullyConnected) { | if (!pfrom->fSuccessfullyConnected) { | ||||
// Must have a verack message before anything else | // Must have a verack message before anything else | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
Misbehaving(pfrom, 1, "missing-verack"); | Misbehaving(pfrom, 10, "missing-verack"); | ||||
return false; | return false; | ||||
} | } | ||||
if (strCommand == NetMsgType::ADDR) { | if (strCommand == NetMsgType::ADDR) { | ||||
std::vector<CAddress> vAddr; | std::vector<CAddress> vAddr; | ||||
vRecv >> vAddr; | vRecv >> vAddr; | ||||
// Don't want addr from older versions unless seeding | // Don't want addr from older versions unless seeding | ||||
▲ Show 20 Lines • Show All 2,495 Lines • Show Last 20 Lines |