Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 3,616 Lines • ▼ Show 20 Lines | if (strCommand == NetMsgType::AVAPOLL && !fImporting && !fReindex && | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
for (unsigned int n = 0; n < nCount; n++) { | for (unsigned int n = 0; n < nCount; n++) { | ||||
CInv inv; | CInv inv; | ||||
vRecv >> inv; | vRecv >> inv; | ||||
uint32_t error = -1; | uint32_t error = -1; | ||||
if (inv.type == MSG_BLOCK) { | if (inv.type == MSG_BLOCK) { | ||||
BlockMap::iterator mi = | auto blockIndex = LookupBlockIndex(BlockHash(inv.hash)); | ||||
mapBlockIndex.find(BlockHash(inv.hash)); | if (blockIndex) { | ||||
if (mi != mapBlockIndex.end()) { | error = ::ChainActive().Contains(blockIndex) ? 0 : 1; | ||||
error = ::ChainActive().Contains(mi->second) ? 0 : 1; | |||||
} | } | ||||
} | } | ||||
votes.emplace_back(error, inv.hash); | votes.emplace_back(error, inv.hash); | ||||
} | } | ||||
} | } | ||||
// Send the query to the node. | // Send the query to the node. | ||||
▲ Show 20 Lines • Show All 1,470 Lines • Show Last 20 Lines |