Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/delegation.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | public: | ||||
const DelegationId &getId() const { return dgid; } | const DelegationId &getId() const { return dgid; } | ||||
const ProofId &getProofId() const { return proofid; } | const ProofId &getProofId() const { return proofid; } | ||||
SERIALIZE_METHODS(Delegation, obj) { | SERIALIZE_METHODS(Delegation, obj) { | ||||
READWRITE(obj.proofid, obj.levels); | READWRITE(obj.proofid, obj.levels); | ||||
SER_READ(obj, obj.dgid = obj.computeDelegationId()); | SER_READ(obj, obj.dgid = obj.computeDelegationId()); | ||||
} | } | ||||
/** | |||||
* Verify the delegation: check all the signatures at | |||||
* each level. | |||||
* | |||||
* @param[out] state Verification state of the delegation. | |||||
* @param[in] proof Avalanche proof corresponding to this delegation. | |||||
* @param[out] auth pubkey for the last level of the delegation. | |||||
* @return true if the verification is successful, else false | |||||
*/ | |||||
bool verify(DelegationState &state, const Proof &proof, | bool verify(DelegationState &state, const Proof &proof, | ||||
CPubKey &auth) const; | CPubKey &auth) const; | ||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_DELEGATION_H | #endif // BITCOIN_AVALANCHE_DELEGATION_H |