Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proofpool.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | void ProofPool::rescan(PeerManager &peerManager) { | ||||
for (auto &entry : previousPool) { | for (auto &entry : previousPool) { | ||||
peerManager.registerProof(entry.proof); | peerManager.registerProof(entry.proof); | ||||
} | } | ||||
} | } | ||||
ProofRef ProofPool::getProof(const ProofId &proofid) const { | ProofRef ProofPool::getProof(const ProofId &proofid) const { | ||||
auto &poolView = pool.get<by_proofid>(); | auto &poolView = pool.get<by_proofid>(); | ||||
auto it = poolView.find(proofid); | auto it = poolView.find(proofid); | ||||
return it == poolView.end() ? nullptr : it->proof; | return it == poolView.end() ? ProofRef() : it->proof; | ||||
} | } | ||||
ProofRef ProofPool::getProof(const COutPoint &outpoint) const { | ProofRef ProofPool::getProof(const COutPoint &outpoint) const { | ||||
auto it = pool.find(outpoint); | auto it = pool.find(outpoint); | ||||
return it == pool.end() ? nullptr : it->proof; | return it == pool.end() ? ProofRef() : it->proof; | ||||
} | } | ||||
} // namespace avalanche | } // namespace avalanche |