Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 4,200 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::AVAHELLO) { | ||||
if (!AlreadyHaveProof(proofid)) { | if (!AlreadyHaveProof(proofid)) { | ||||
const bool preferred = isPreferredDownloadPeer(pfrom); | const bool preferred = isPreferredDownloadPeer(pfrom); | ||||
LOCK(cs_proofrequest); | LOCK(cs_proofrequest); | ||||
AddProofAnnouncement(pfrom, proofid, | AddProofAnnouncement(pfrom, proofid, | ||||
GetTime<std::chrono::microseconds>(), | GetTime<std::chrono::microseconds>(), | ||||
preferred); | preferred); | ||||
} | } | ||||
if (gArgs.GetBoolArg("-enableavalanchepeerdiscovery", | |||||
AVALANCHE_DEFAULT_PEER_DISCOVERY_ENABLED)) { | |||||
// Don't check the return value. If it fails we probably don't know | |||||
// about the proof yet. | |||||
g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | |||||
return pm.addNode(pfrom.GetId(), proofid); | |||||
}); | |||||
} | |||||
return; | return; | ||||
} | } | ||||
if (msg_type == NetMsgType::AVAPOLL) { | if (msg_type == NetMsgType::AVAPOLL) { | ||||
auto now = std::chrono::steady_clock::now(); | auto now = std::chrono::steady_clock::now(); | ||||
int64_t cooldown = | int64_t cooldown = | ||||
gArgs.GetArg("-avacooldown", AVALANCHE_DEFAULT_COOLDOWN); | gArgs.GetArg("-avacooldown", AVALANCHE_DEFAULT_COOLDOWN); | ||||
▲ Show 20 Lines • Show All 1,681 Lines • Show Last 20 Lines |