diff --git a/src/avalanche/protocol.h b/src/avalanche/protocol.h index cd05fa457..c80616ac9 100644 --- a/src/avalanche/protocol.h +++ b/src/avalanche/protocol.h @@ -1,84 +1,84 @@ // Copyright (c) 2020 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_AVALANCHE_PROTOCOL_H #define BITCOIN_AVALANCHE_PROTOCOL_H #include #include // for CInv #include #include #include #include namespace avalanche { class Vote { uint32_t error; uint256 hash; public: Vote() : error(-1), hash() {} Vote(uint32_t errorIn, uint256 hashIn) : error(errorIn), hash(hashIn) {} const uint256 &GetHash() const { return hash; } uint32_t GetError() const { return error; } // serialization support SERIALIZE_METHODS(Vote, obj) { READWRITE(obj.error, obj.hash); } }; class Response { uint64_t round; uint32_t cooldown; std::vector votes; public: Response() : round(-1), cooldown(-1) {} Response(uint64_t roundIn, uint32_t cooldownIn, std::vector votesIn) : round(roundIn), cooldown(cooldownIn), votes(votesIn) {} uint64_t getRound() const { return round; } uint32_t getCooldown() const { return cooldown; } const std::vector &GetVotes() const { return votes; } // serialization support SERIALIZE_METHODS(Response, obj) { READWRITE(obj.round, obj.cooldown, obj.votes); } }; class Poll { uint64_t round; std::vector invs; public: Poll(uint64_t roundIn, std::vector invsIn) : round(roundIn), invs(invsIn) {} uint64_t GetRound() { return round; } const std::vector &GetInvs() const { return invs; } // serialization support SERIALIZE_METHODS(Poll, obj) { READWRITE(obj.round, obj.invs); } }; class Hello { Delegation delegation; SchnorrSig sig; public: Hello(Delegation delegationIn, SchnorrSig sigIn) : delegation(std::move(delegationIn)), sig(sigIn) {} - std::array GetSig() { return sig; } + SchnorrSig GetSig() { return sig; } // serialization support SERIALIZE_METHODS(Hello, obj) { READWRITE(obj.delegation, obj.sig); } }; } // namespace avalanche #endif // BITCOIN_AVALANCHE_PROTOCOL_H