Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proofbuilder.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | ProofRef ProofBuilder::build() { | ||||
std::vector<SignedStake> signedStakes; | std::vector<SignedStake> signedStakes; | ||||
signedStakes.reserve(stakes.size()); | signedStakes.reserve(stakes.size()); | ||||
while (!stakes.empty()) { | while (!stakes.empty()) { | ||||
auto handle = stakes.extract(stakes.begin()); | auto handle = stakes.extract(stakes.begin()); | ||||
signedStakes.push_back(handle.value().sign(commitment)); | signedStakes.push_back(handle.value().sign(commitment)); | ||||
} | } | ||||
return std::make_shared<Proof>( | return ProofRef::make(sequence, expirationTime, masterKey.GetPubKey(), | ||||
sequence, expirationTime, masterKey.GetPubKey(), | std::move(signedStakes), payoutScriptPubKey, | ||||
std::move(signedStakes), payoutScriptPubKey, std::move(proofSignature)); | std::move(proofSignature)); | ||||
} | } | ||||
LimitedProofId ProofBuilder::getLimitedProofId() const { | LimitedProofId ProofBuilder::getLimitedProofId() const { | ||||
CHashWriter ss(SER_GETHASH, 0); | CHashWriter ss(SER_GETHASH, 0); | ||||
ss << sequence; | ss << sequence; | ||||
ss << expirationTime; | ss << expirationTime; | ||||
if (!Proof::useLegacy(gArgs)) { | if (!Proof::useLegacy(gArgs)) { | ||||
Show All 20 Lines |