Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,086 Lines • ▼ Show 20 Lines | if (txinfo.tx) { | ||||
} | } | ||||
} | } | ||||
return {}; | return {}; | ||||
} | } | ||||
//! Determine whether or not a peer can request a proof, and return it (or | //! Determine whether or not a peer can request a proof, and return it (or | ||||
//! nullptr if not found or not allowed). | //! nullptr if not found or not allowed). | ||||
static std::shared_ptr<avalanche::Proof> | static avalanche::ProofRef | ||||
FindProofForGetData(const CNode &peer, const avalanche::ProofId &proofid, | FindProofForGetData(const CNode &peer, const avalanche::ProofId &proofid, | ||||
const std::chrono::seconds now) { | const std::chrono::seconds now) { | ||||
std::shared_ptr<avalanche::Proof> proof = nullptr; | avalanche::ProofRef proof = nullptr; | ||||
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. | ||||
▲ Show 20 Lines • Show All 3,853 Lines • Show Last 20 Lines |