Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 4,404 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::AVAPROOF) { | ||||
// cs_main and that creates a potential deadlock during shutdown | // cs_main and that creates a potential deadlock during shutdown | ||||
if (g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | if (g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | ||||
return pm.registerProof(proof); | return pm.registerProof(proof); | ||||
})) { | })) { | ||||
WITH_LOCK(cs_proofrequest, m_proofrequest.ForgetInvId(proofid)); | WITH_LOCK(cs_proofrequest, m_proofrequest.ForgetInvId(proofid)); | ||||
RelayProof(proofid, m_connman); | RelayProof(proofid, m_connman); | ||||
pfrom.nLastProofTime = GetTime(); | |||||
LogPrint(BCLog::NET, "New avalanche proof: peer=%d, proofid %s\n", | LogPrint(BCLog::NET, "New avalanche proof: peer=%d, proofid %s\n", | ||||
nodeid, proofid.ToString()); | nodeid, proofid.ToString()); | ||||
} else { | } else { | ||||
// If the proof couldn't be added, it can be either orphan or | // If the proof couldn't be added, it can be either orphan or | ||||
// invalid. In the latter case we should increase the ban score. | // invalid. In the latter case we should increase the ban score. | ||||
// TODO improve the ban reason by printing the validation state | // TODO improve the ban reason by printing the validation state | ||||
if (!g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | if (!g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | ||||
return pm.getOrphan(proofid); | return pm.getOrphan(proofid); | ||||
▲ Show 20 Lines • Show All 1,488 Lines • Show Last 20 Lines |