Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/protocol.h
// Copyright (c) 2020 The Bitcoin developers | // Copyright (c) 2020 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_AVALANCHE_PROTOCOL_H | #ifndef BITCOIN_AVALANCHE_PROTOCOL_H | ||||
#define BITCOIN_AVALANCHE_PROTOCOL_H | #define BITCOIN_AVALANCHE_PROTOCOL_H | ||||
#include <avalanche/delegation.h> | |||||
#include <protocol.h> // for CInv | #include <protocol.h> // for CInv | ||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <uint256.h> | #include <uint256.h> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <vector> | #include <vector> | ||||
namespace avalanche { | namespace avalanche { | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | public: | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(round); | READWRITE(round); | ||||
READWRITE(invs); | READWRITE(invs); | ||||
} | } | ||||
}; | }; | ||||
class Hello { | |||||
Delegation delegation; | |||||
std::array<uint8_t, 64> sig; | |||||
public: | |||||
Hello(Delegation delegationIn, std::array<uint8_t, 64> sigIn) | |||||
: delegation(std::move(delegationIn)), sig(sigIn) {} | |||||
// serialization support | |||||
ADD_SERIALIZE_METHODS; | |||||
template <typename Stream, typename Operation> | |||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
READWRITE(delegation); | |||||
READWRITE(sig); | |||||
} | |||||
}; | |||||
} // namespace avalanche | } // namespace avalanche | ||||
#endif // BITCOIN_AVALANCHE_PROTOCOL_H | #endif // BITCOIN_AVALANCHE_PROTOCOL_H |