Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 504 Lines • ▼ Show 20 Lines | auto registerVoteItems = [&](auto voteRecordsWriteView, auto &updates, | ||||
auto it = voteRecordsWriteView->find(item); | auto it = voteRecordsWriteView->find(item); | ||||
if (it == voteRecordsWriteView.end()) { | if (it == voteRecordsWriteView.end()) { | ||||
// We are not voting on that item anymore. | // We are not voting on that item anymore. | ||||
continue; | continue; | ||||
} | } | ||||
auto &vr = it->second; | auto &vr = it->second; | ||||
if (!vr.registerVote(nodeid, v.GetError())) { | if (!vr.registerVote(nodeid, v.GetError())) { | ||||
if (vr.isStale()) { | |||||
updates.emplace_back(item, VoteStatus::Stale); | |||||
// Just drop stale votes. If we see this item again, we'll | |||||
// do a new vote. | |||||
voteRecordsWriteView->erase(it); | |||||
} | |||||
// This vote did not provide any extra information, move on. | // This vote did not provide any extra information, move on. | ||||
continue; | continue; | ||||
} | } | ||||
if (!vr.hasFinalized()) { | if (!vr.hasFinalized()) { | ||||
// This item has note been finalized, so we have nothing more to | // This item has note been finalized, so we have nothing more to | ||||
// do. | // do. | ||||
updates.emplace_back(item, vr.isAccepted() | updates.emplace_back(item, vr.isAccepted() | ||||
▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines |