Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | bool Processor::isAccepted(const CBlockIndex *pindex) const { | ||||
auto it = r->find(pindex); | auto it = r->find(pindex); | ||||
if (it == r.end()) { | if (it == r.end()) { | ||||
return false; | return false; | ||||
} | } | ||||
return it->second.isAccepted(); | return it->second.isAccepted(); | ||||
} | } | ||||
bool Processor::isAccepted(const std::shared_ptr<Proof> &proof) const { | |||||
auto r = proofVoteRecords.getReadView(); | |||||
auto it = r->find(proof); | |||||
if (it == r.end()) { | |||||
return false; | |||||
} | |||||
return it->second.isAccepted(); | |||||
} | |||||
int Processor::getConfidence(const CBlockIndex *pindex) const { | int Processor::getConfidence(const CBlockIndex *pindex) const { | ||||
auto r = blockVoteRecords.getReadView(); | auto r = blockVoteRecords.getReadView(); | ||||
auto it = r->find(pindex); | auto it = r->find(pindex); | ||||
if (it == r.end()) { | if (it == r.end()) { | ||||
return -1; | return -1; | ||||
} | } | ||||
return it->second.getConfidence(); | return it->second.getConfidence(); | ||||
} | } | ||||
int Processor::getConfidence(const std::shared_ptr<Proof> &proof) const { | |||||
auto r = proofVoteRecords.getReadView(); | |||||
auto it = r->find(proof); | |||||
if (it == r.end()) { | |||||
return -1; | |||||
} | |||||
return it->second.getConfidence(); | |||||
} | |||||
namespace { | namespace { | ||||
/** | /** | ||||
* When using TCP, we need to sign all messages as the transport layer is | * When using TCP, we need to sign all messages as the transport layer is | ||||
* not secure. | * not secure. | ||||
*/ | */ | ||||
class TCPResponse { | class TCPResponse { | ||||
Response response; | Response response; | ||||
SchnorrSig sig; | SchnorrSig sig; | ||||
▲ Show 20 Lines • Show All 364 Lines • Show Last 20 Lines |