Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proof.h
Show All 36 Lines | |||||
class ProofValidationState; | class ProofValidationState; | ||||
using StakeId = uint256; | using StakeId = uint256; | ||||
struct StakeCommitment : public uint256 { | struct StakeCommitment : public uint256 { | ||||
explicit StakeCommitment() : uint256() {} | explicit StakeCommitment() : uint256() {} | ||||
explicit StakeCommitment(const uint256 &b) : uint256(b) {} | explicit StakeCommitment(const uint256 &b) : uint256(b) {} | ||||
StakeCommitment(const ProofId &proofid, int64_t expirationTime, | |||||
const CPubKey &master); | |||||
}; | }; | ||||
class Stake { | class Stake { | ||||
COutPoint utxo; | COutPoint utxo; | ||||
Amount amount; | Amount amount; | ||||
uint32_t height; | uint32_t height; | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | public: | ||||
uint64_t getSequence() const { return sequence; } | uint64_t getSequence() const { return sequence; } | ||||
int64_t getExpirationTime() const { return expirationTime; } | int64_t getExpirationTime() const { return expirationTime; } | ||||
const CPubKey &getMaster() const { return master; } | const CPubKey &getMaster() const { return master; } | ||||
const std::vector<SignedStake> &getStakes() const { return stakes; } | const std::vector<SignedStake> &getStakes() const { return stakes; } | ||||
const ProofId &getId() const { return proofid; } | const ProofId &getId() const { return proofid; } | ||||
const LimitedProofId &getLimitedId() const { return limitedProofId; } | const LimitedProofId &getLimitedId() const { return limitedProofId; } | ||||
const StakeCommitment getStakeCommitment() const { | const StakeCommitment getStakeCommitment() const { | ||||
return StakeCommitment(proofid); | return StakeCommitment(proofid, expirationTime, master); | ||||
} | }; | ||||
uint32_t getScore() const; | uint32_t getScore() const; | ||||
bool verify(ProofValidationState &state) const; | bool verify(ProofValidationState &state) const; | ||||
bool verify(ProofValidationState &state, const CCoinsView &view) const; | bool verify(ProofValidationState &state, const CCoinsView &view) const; | ||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_PROOF_H | #endif // BITCOIN_AVALANCHE_PROOF_H |