diff --git a/src/avalanche/proof.h b/src/avalanche/proof.h --- a/src/avalanche/proof.h +++ b/src/avalanche/proof.h @@ -145,6 +145,8 @@ static bool FromHex(Proof &proof, const std::string &hexProof, bilingual_str &errorOut); + static uint32_t amountToScore(Amount amount); + uint64_t getSequence() const { return sequence; } int64_t getExpirationTime() const { return expirationTime; } const CPubKey &getMaster() const { return master; } diff --git a/src/avalanche/proof.cpp b/src/avalanche/proof.cpp --- a/src/avalanche/proof.cpp +++ b/src/avalanche/proof.cpp @@ -102,7 +102,11 @@ total += s.getStake().getAmount(); } - score = uint32_t((100 * total) / COIN); + score = amountToScore(total); +} + +uint32_t Proof::amountToScore(Amount amount) { + return (100 * amount) / COIN; } Amount Proof::getStakedAmount() const {