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 2,620 Lines • ▼ Show 20 Lines | FindProofForGetData(const CNode &peer, const avalanche::ProofId &proofid, | ||||
bool send_unconditionally = | bool send_unconditionally = | ||||
g_avalanche->withPeerManager([&](const avalanche::PeerManager &pm) { | g_avalanche->withPeerManager([&](const avalanche::PeerManager &pm) { | ||||
return pm.forPeer(proofid, [&](const avalanche::Peer &peer) { | return pm.forPeer(proofid, [&](const avalanche::Peer &peer) { | ||||
proof = peer.proof; | proof = peer.proof; | ||||
// If we know that proof for long enough, allow for requesting | // If we know that proof for long enough, allow for requesting | ||||
// it. | // it. | ||||
return peer.registration_time <= | auto registrationTime = pm.getProofRegistrationTime(proofid); | ||||
return registrationTime && registrationTime.value() <= | |||||
now - UNCONDITIONAL_RELAY_DELAY; | now - UNCONDITIONAL_RELAY_DELAY; | ||||
}); | }); | ||||
}); | }); | ||||
if (!proof) { | if (!proof) { | ||||
// Always send our local proof if it gets requested, assuming it's | // Always send our local proof if it gets requested, assuming it's | ||||
// valid. This will make it easier to bind with peers upon startup where | // valid. This will make it easier to bind with peers upon startup where | ||||
// the status of our proof is unknown pending for a block. Note that it | // the status of our proof is unknown pending for a block. Note that it | ||||
// still needs to have been announced first (presumably via an avahello | // still needs to have been announced first (presumably via an avahello | ||||
▲ Show 20 Lines • Show All 4,456 Lines • Show Last 20 Lines |