Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 4,388 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::AVARESPONSE) { | ||||
} | } | ||||
pfrom.m_avalanche_state->invsVoted(response.GetVotes().size()); | pfrom.m_avalanche_state->invsVoted(response.GetVotes().size()); | ||||
if (updates.size()) { | if (updates.size()) { | ||||
for (avalanche::BlockUpdate &u : updates) { | for (avalanche::BlockUpdate &u : updates) { | ||||
CBlockIndex *pindex = u.getBlockIndex(); | CBlockIndex *pindex = u.getBlockIndex(); | ||||
switch (u.getStatus()) { | switch (u.getStatus()) { | ||||
case avalanche::BlockUpdate::Status::Invalid: | case avalanche::VoteStatus::Invalid: | ||||
case avalanche::BlockUpdate::Status::Rejected: { | case avalanche::VoteStatus::Rejected: { | ||||
LogPrintf("Avalanche rejected %s, parking\n", | LogPrintf("Avalanche rejected %s, parking\n", | ||||
pindex->GetBlockHash().GetHex()); | pindex->GetBlockHash().GetHex()); | ||||
BlockValidationState state; | BlockValidationState state; | ||||
::ChainstateActive().ParkBlock(config, state, pindex); | ::ChainstateActive().ParkBlock(config, state, pindex); | ||||
if (!state.IsValid()) { | if (!state.IsValid()) { | ||||
LogPrintf("ERROR: Database error: %s\n", | LogPrintf("ERROR: Database error: %s\n", | ||||
state.GetRejectReason()); | state.GetRejectReason()); | ||||
return; | return; | ||||
} | } | ||||
} break; | } break; | ||||
case avalanche::BlockUpdate::Status::Accepted: | case avalanche::VoteStatus::Accepted: | ||||
case avalanche::BlockUpdate::Status::Finalized: { | case avalanche::VoteStatus::Finalized: { | ||||
LogPrintf("Avalanche accepted %s\n", | LogPrintf("Avalanche accepted %s\n", | ||||
pindex->GetBlockHash().GetHex()); | pindex->GetBlockHash().GetHex()); | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
UnparkBlock(pindex); | UnparkBlock(pindex); | ||||
} break; | } break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,541 Lines • Show Last 20 Lines |