Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 1,620 Lines • ▼ Show 20 Lines | else if (strCommand == NetMsgType::SENDCMPCT) { | ||||
vRecv >> fAnnounceUsingCMPCTBLOCK >> nCMPCTBLOCKVersion; | vRecv >> fAnnounceUsingCMPCTBLOCK >> nCMPCTBLOCKVersion; | ||||
if (nCMPCTBLOCKVersion == 1) { | if (nCMPCTBLOCKVersion == 1) { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
// fProvidesHeaderAndIDs is used to "lock in" version of compact | // fProvidesHeaderAndIDs is used to "lock in" version of compact | ||||
// blocks we send. | // blocks we send. | ||||
if (!State(pfrom->GetId())->fProvidesHeaderAndIDs) { | if (!State(pfrom->GetId())->fProvidesHeaderAndIDs) { | ||||
State(pfrom->GetId())->fProvidesHeaderAndIDs = true; | State(pfrom->GetId())->fProvidesHeaderAndIDs = true; | ||||
} | } | ||||
if (nCMPCTBLOCKVersion != 2) // ignore later version announces | |||||
State(pfrom->GetId())->fPreferHeaderAndIDs = | State(pfrom->GetId())->fPreferHeaderAndIDs = | ||||
fAnnounceUsingCMPCTBLOCK; | fAnnounceUsingCMPCTBLOCK; | ||||
if (!State(pfrom->GetId())->fSupportsDesiredCmpctVersion) { | if (!State(pfrom->GetId())->fSupportsDesiredCmpctVersion) { | ||||
State(pfrom->GetId())->fSupportsDesiredCmpctVersion = | State(pfrom->GetId())->fSupportsDesiredCmpctVersion = true; | ||||
(nCMPCTBLOCKVersion == 1); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
else if (strCommand == NetMsgType::INV) { | else if (strCommand == NetMsgType::INV) { | ||||
std::vector<CInv> vInv; | std::vector<CInv> vInv; | ||||
vRecv >> vInv; | vRecv >> vInv; | ||||
if (vInv.size() > MAX_INV_SZ) { | if (vInv.size() > MAX_INV_SZ) { | ||||
▲ Show 20 Lines • Show All 2,014 Lines • Show Last 20 Lines |