Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche.cpp
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < size; i++) { | ||||
} | } | ||||
} | } | ||||
std::map<CBlockIndex *, AvalancheVote> responseIndex; | std::map<CBlockIndex *, AvalancheVote> responseIndex; | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
for (auto &v : votes) { | for (auto &v : votes) { | ||||
BlockMap::iterator mi = mapBlockIndex.find(v.GetHash()); | BlockMap::iterator mi = mapBlockIndex.find(BlockHash(v.GetHash())); | ||||
if (mi == mapBlockIndex.end()) { | if (mi == mapBlockIndex.end()) { | ||||
// This should not happen, but just in case... | // This should not happen, but just in case... | ||||
continue; | continue; | ||||
} | } | ||||
CBlockIndex *pindex = mi->second; | CBlockIndex *pindex = mi->second; | ||||
if (!IsWorthPolling(pindex)) { | if (!IsWorthPolling(pindex)) { | ||||
// There is no point polling this block. | // There is no point polling this block. | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | void AvalancheProcessor::clearTimedoutRequests() { | ||||
for (const auto &p : timedout_items) { | for (const auto &p : timedout_items) { | ||||
const CInv &inv = p.first; | const CInv &inv = p.first; | ||||
assert(inv.type == MSG_BLOCK); | assert(inv.type == MSG_BLOCK); | ||||
CBlockIndex *pindex; | CBlockIndex *pindex; | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
BlockMap::iterator mi = mapBlockIndex.find(inv.hash); | BlockMap::iterator mi = mapBlockIndex.find(BlockHash(inv.hash)); | ||||
if (mi == mapBlockIndex.end()) { | if (mi == mapBlockIndex.end()) { | ||||
continue; | continue; | ||||
} | } | ||||
pindex = mi->second; | pindex = mi->second; | ||||
} | } | ||||
auto w = vote_records.getWriteView(); | auto w = vote_records.getWriteView(); | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |