Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proof.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | void Proof::computeProofId() { | ||||
ss << expirationTime; | ss << expirationTime; | ||||
WriteCompactSize(ss, stakes.size()); | WriteCompactSize(ss, stakes.size()); | ||||
for (const SignedStake &s : stakes) { | for (const SignedStake &s : stakes) { | ||||
ss << s.getStake(); | ss << s.getStake(); | ||||
} | } | ||||
limitedProofId = LimitedProofId(ss.GetHash()); | limitedProofId = LimitedProofId(ss.GetHash()); | ||||
proofid = limitedProofId.computeProofId(master); | |||||
CHashWriter ss2(SER_GETHASH, 0); | |||||
ss2 << limitedProofId; | |||||
ss2 << master; | |||||
proofid = ProofId(ss2.GetHash()); | |||||
} | } | ||||
uint32_t Proof::getScore() const { | uint32_t Proof::getScore() const { | ||||
Amount total = Amount::zero(); | Amount total = Amount::zero(); | ||||
for (const SignedStake &s : stakes) { | for (const SignedStake &s : stakes) { | ||||
total += s.getStake().getAmount(); | total += s.getStake().getAmount(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |