Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 4,973 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::BLOCK) { | ||||
} else { | } else { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
mapBlockSource.erase(hash); | mapBlockSource.erase(hash); | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
if (msg_type == NetMsgType::AVAHELLO) { | if (msg_type == NetMsgType::AVAHELLO) { | ||||
if (!pfrom.m_avalanche_state) { | if (pfrom.m_avalanche_state) { | ||||
pfrom.m_avalanche_state = std::make_unique<CNode::AvalancheState>(); | LogPrint( | ||||
BCLog::AVALANCHE, | |||||
"Ignoring avahello from peer %d: already in our node set\n", | |||||
pfrom.GetId()); | |||||
return; | |||||
} | } | ||||
pfrom.m_avalanche_state = std::make_unique<CNode::AvalancheState>(); | |||||
CHashVerifier<CDataStream> verifier(&vRecv); | CHashVerifier<CDataStream> verifier(&vRecv); | ||||
avalanche::Delegation delegation; | avalanche::Delegation delegation; | ||||
verifier >> delegation; | verifier >> delegation; | ||||
avalanche::DelegationState state; | avalanche::DelegationState state; | ||||
CPubKey &pubkey = pfrom.m_avalanche_state->pubkey; | CPubKey &pubkey = pfrom.m_avalanche_state->pubkey; | ||||
if (!delegation.verify(state, pubkey)) { | if (!delegation.verify(state, pubkey)) { | ||||
Misbehaving(pfrom, 100, "invalid-delegation"); | Misbehaving(pfrom, 100, "invalid-delegation"); | ||||
▲ Show 20 Lines • Show All 1,994 Lines • Show Last 20 Lines |