Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proof.h
Show All 33 Lines | class Stake { | ||||
COutPoint utxo; | COutPoint utxo; | ||||
Amount amount; | Amount amount; | ||||
uint32_t height; | uint32_t height; | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
public: | public: | ||||
explicit Stake() = default; | explicit Stake() = default; | ||||
Stake(COutPoint utxo_, Amount amount_, uint32_t height_, CPubKey pubkey_) | Stake(COutPoint utxo_, Amount amount_, uint32_t height_, bool is_coinbase, | ||||
: utxo(utxo_), amount(amount_), height(height_), | CPubKey pubkey_) | ||||
: utxo(utxo_), amount(amount_), height(height_ << 1 | is_coinbase), | |||||
pubkey(std::move(pubkey_)) {} | pubkey(std::move(pubkey_)) {} | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(utxo); | READWRITE(utxo); | ||||
READWRITE(amount); | READWRITE(amount); | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |