Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/delegation.h
Show All 37 Lines | Delegation(const ProofId &proofid_, const DelegationId &dgid_, | ||||
std::vector<Level> levels_) | std::vector<Level> levels_) | ||||
: proofid(proofid_), dgid(dgid_), levels(std::move(levels_)) {} | : proofid(proofid_), dgid(dgid_), levels(std::move(levels_)) {} | ||||
public: | public: | ||||
explicit Delegation() {} | explicit Delegation() {} | ||||
const DelegationId &getId() const { return dgid; } | const DelegationId &getId() const { return dgid; } | ||||
const ProofId &getProofId() const { return proofid; } | const ProofId &getProofId() const { return proofid; } | ||||
std::optional<CPubKey> getMaster() const; | |||||
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()); | ||||
} | } | ||||
bool verify(DelegationState &state, const Proof &proof, | bool verify(DelegationState &state, const CPubKey &proofMaster, | ||||
CPubKey &auth) const; | const LimitedProofId &limitedProofId, CPubKey &auth) const; | ||||
deadalnix: Why aren't these part of the delegation?
It seems that they are necessary to verify anyways… | |||||
}; | }; | ||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_DELEGATION_H | #endif // BITCOIN_AVALANCHE_DELEGATION_H |
Why aren't these part of the delegation?
It seems that they are necessary to verify anyways, and the branching all over the place over the second master being option is a hint that something is not quite right.