diff --git a/src/avalanche/processor.h b/src/avalanche/processor.h --- a/src/avalanche/processor.h +++ b/src/avalanche/processor.h @@ -56,7 +56,7 @@ struct VoteRecord; enum struct VoteStatus : uint8_t { - Invalid, + Invalidated, Rejected, Accepted, Finalized, diff --git a/src/avalanche/processor.cpp b/src/avalanche/processor.cpp --- a/src/avalanche/processor.cpp +++ b/src/avalanche/processor.cpp @@ -509,8 +509,9 @@ // We just finalized a vote. If it is valid, then let the caller // know. Either way, remove the item from the map. - updates.emplace_back(item, vr.isAccepted() ? VoteStatus::Finalized - : VoteStatus::Invalid); + updates.emplace_back(item, vr.isAccepted() + ? VoteStatus::Finalized + : VoteStatus::Invalidated); voteRecordsWriteView->erase(it); } }; diff --git a/src/avalanche/test/processor_tests.cpp b/src/avalanche/test/processor_tests.cpp --- a/src/avalanche/test/processor_tests.cpp +++ b/src/avalanche/test/processor_tests.cpp @@ -425,7 +425,7 @@ CBlockIndex *pindex = &index; std::set status{ - VoteStatus::Invalid, + VoteStatus::Invalidated, VoteStatus::Rejected, VoteStatus::Accepted, VoteStatus::Finalized, @@ -601,7 +601,7 @@ BOOST_CHECK(!m_processor->isAccepted(item)); BOOST_CHECK_EQUAL(updates.size(), 1); BOOST_CHECK(updates[0].getVoteItem() == item); - BOOST_CHECK(updates[0].getStatus() == VoteStatus::Invalid); + BOOST_CHECK(updates[0].getStatus() == VoteStatus::Invalidated); updates.clear(); // Once the decision is finalized, there is no poll for it. diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -5151,7 +5151,7 @@ auto rejectionMode = avalanche::PeerManager::RejectionMode::DEFAULT; auto nextCooldownTimePoint = GetTime(); switch (u.getStatus()) { - case avalanche::VoteStatus::Invalid: + case avalanche::VoteStatus::Invalidated: rejectionMode = avalanche::PeerManager::RejectionMode::INVALIDATE; WITH_LOCK(cs_rejectedProofs, @@ -5204,7 +5204,7 @@ for (avalanche::BlockUpdate &u : blockUpdates) { CBlockIndex *pindex = u.getVoteItem(); switch (u.getStatus()) { - case avalanche::VoteStatus::Invalid: + case avalanche::VoteStatus::Invalidated: case avalanche::VoteStatus::Rejected: { LogPrintf("Avalanche rejected %s, parking\n", pindex->GetBlockHash().GetHex());