Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proofbuilder.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | ProofId ProofBuilder::getProofId() const { | ||||
CHashWriter ss2(SER_GETHASH, 0); | CHashWriter ss2(SER_GETHASH, 0); | ||||
ss2 << ss.GetHash(); | ss2 << ss.GetHash(); | ||||
ss2 << master; | ss2 << master; | ||||
return ProofId(ss2.GetHash()); | return ProofId(ss2.GetHash()); | ||||
} | } | ||||
Proof ProofBuilder::buildRandom(uint32_t score) { | |||||
ProofBuilder pb(0, std::numeric_limits<uint32_t>::max(), CPubKey()); | |||||
pb.addUTXO(COutPoint(TxId(GetRandHash()), 0), (int64_t(score) * COIN) / 100, | |||||
0, false, CKey::MakeCompressedKey()); | |||||
return pb.build(); | |||||
} | |||||
} // namespace avalanche | } // namespace avalanche |