5 #ifndef BITCOIN_AVALANCHE_PROOF_H 6 #define BITCOIN_AVALANCHE_PROOF_H 22 class ProofValidationState;
32 explicit Stake() =
default;
35 : utxo(utxo_), amount(amount_), height(height_ << 1 | is_coinbase),
36 pubkey(
std::move(pubkey_)) {}
40 template <
typename Stream,
typename Operation>
59 std::array<uint8_t, 64>
sig;
64 : stake(
std::move(stake_)), sig(
std::move(sig_)) {}
68 template <
typename Stream,
typename Operation>
77 bool verify(
const ProofId &proofid)
const;
90 Proof() : sequence(0), expirationTime(0), master(), stakes(), proofid() {}
91 Proof(uint64_t sequence_, int64_t expirationTime_,
CPubKey master_,
92 std::vector<SignedStake> stakes_)
93 : sequence(sequence_), expirationTime(expirationTime_),
94 master(
std::move(master_)), stakes(
std::move(stakes_)),
95 proofid(computeProofId()) {}
99 template <
typename Stream,
typename Operation>
106 if (ser_action.ForRead()) {
107 proofid = computeProofId();
114 const std::vector<SignedStake> &
getStakes()
const {
return stakes; }
117 uint32_t getScore()
const;
125 #endif // BITCOIN_AVALANCHE_PROOF_H
void SerializationOp(Stream &s, Operation ser_action)
std::array< uint8_t, 64 > sig
const std::vector< SignedStake > & getStakes() const
const CPubKey & getMaster() const
int64_t getExpirationTime() const
uint256 getHash(const ProofId &proofid) const
const COutPoint & getUTXO() const
Abstract view on the open txout dataset.
std::vector< SignedStake > stakes
An encapsulated public key.
Stake(COutPoint utxo_, Amount amount_, uint32_t height_, bool is_coinbase, CPubKey pubkey_)
const CPubKey & getPubkey() const
SignedStake(Stake stake_, std::array< uint8_t, 64 > sig_)
const Stake & getStake() const
An outpoint - a combination of a transaction hash and an index n into its vout.
Proof(uint64_t sequence_, int64_t expirationTime_, CPubKey master_, std::vector< SignedStake > stakes_)
void SerializationOp(Stream &s, Operation ser_action)
const ProofId & getId() const
uint32_t getHeight() const
std::array< uint8_t, 64 > sig
void SerializationOp(Stream &s, Operation ser_action)
uint64_t getSequence() const
const std::array< uint8_t, 64 > & getSignature() const