Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/proof.h
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
class Proof { | class Proof { | ||||
uint64_t sequence; | uint64_t sequence; | ||||
int64_t expirationTime; | int64_t expirationTime; | ||||
CPubKey master; | CPubKey master; | ||||
std::vector<SignedStake> stakes; | std::vector<SignedStake> stakes; | ||||
CScript payoutScriptPubKey; | CScript payoutScriptPubKey; | ||||
SchnorrSig signature; | |||||
LimitedProofId limitedProofId; | LimitedProofId limitedProofId; | ||||
ProofId proofid; | ProofId proofid; | ||||
void computeProofId(); | void computeProofId(); | ||||
public: | public: | ||||
Proof() | Proof() | ||||
: sequence(0), expirationTime(0), master(), stakes(), | : sequence(0), expirationTime(0), master(), stakes(), | ||||
payoutScriptPubKey(CScript()), limitedProofId(), proofid() {} | payoutScriptPubKey(CScript()), limitedProofId(), proofid() {} | ||||
Proof(uint64_t sequence_, int64_t expirationTime_, CPubKey master_, | Proof(uint64_t sequence_, int64_t expirationTime_, CPubKey master_, | ||||
std::vector<SignedStake> stakes_, const CScript &payoutScriptPubKey_) | std::vector<SignedStake> stakes_, const CScript &payoutScriptPubKey_, | ||||
SchnorrSig signature_) | |||||
: sequence(sequence_), expirationTime(expirationTime_), | : sequence(sequence_), expirationTime(expirationTime_), | ||||
master(std::move(master_)), stakes(std::move(stakes_)), | master(std::move(master_)), stakes(std::move(stakes_)), | ||||
payoutScriptPubKey(payoutScriptPubKey_) { | payoutScriptPubKey(payoutScriptPubKey_), | ||||
signature(std::move(signature_)) { | |||||
computeProofId(); | computeProofId(); | ||||
} | } | ||||
SERIALIZE_METHODS(Proof, obj) { | SERIALIZE_METHODS(Proof, obj) { | ||||
READWRITE(obj.sequence, obj.expirationTime, obj.master, obj.stakes); | READWRITE(obj.sequence, obj.expirationTime, obj.master, obj.stakes); | ||||
if (!useLegacy()) { | if (!useLegacy()) { | ||||
READWRITE(obj.payoutScriptPubKey); | READWRITE(obj.payoutScriptPubKey, obj.signature); | ||||
} | } | ||||
SER_READ(obj, obj.computeProofId()); | SER_READ(obj, obj.computeProofId()); | ||||
} | } | ||||
static bool useLegacy(); | static bool useLegacy(); | ||||
static bool useLegacy(const ArgsManager &argsman); | static bool useLegacy(const ArgsManager &argsman); | ||||
static bool FromHex(Proof &proof, const std::string &hexProof, | static bool FromHex(Proof &proof, const std::string &hexProof, | ||||
Show All 21 Lines |