mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
273270916e
This commit reflects changes to clang-format rules. Unfortunately, these rule changes create a massive change to the codebase, which causes an apparent rewrite of git history. Git blame's --ignore-rev flag can be used to ignore this commit when attempting to `git blame` some code.
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#ifndef LLARP_DHT_MESSAGES_PUB_INTRO_HPP
|
|
#define LLARP_DHT_MESSAGES_PUB_INTRO_HPP
|
|
#include <dht/message.hpp>
|
|
#include <service/intro_set.hpp>
|
|
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace dht
|
|
{
|
|
struct PublishIntroMessage final : public IMessage
|
|
{
|
|
static const uint64_t MaxPropagationDepth;
|
|
llarp::service::EncryptedIntroSet introset;
|
|
bool relayed = false;
|
|
uint64_t relayOrder = 0;
|
|
uint64_t txID = 0;
|
|
PublishIntroMessage(const Key_t& from, bool relayed_) : IMessage(from), relayed(relayed_)
|
|
{
|
|
}
|
|
|
|
PublishIntroMessage(
|
|
const llarp::service::EncryptedIntroSet& introset_,
|
|
uint64_t tx,
|
|
bool relayed_,
|
|
uint64_t relayOrder_)
|
|
: IMessage({}), introset(introset_), relayed(relayed_), relayOrder(relayOrder_), txID(tx)
|
|
{
|
|
}
|
|
|
|
~PublishIntroMessage() override;
|
|
|
|
bool
|
|
BEncode(llarp_buffer_t* buf) const override;
|
|
|
|
bool
|
|
DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
|
|
|
|
bool
|
|
HandleMessage(
|
|
llarp_dht_context* ctx, std::vector<std::unique_ptr<IMessage>>& replies) const override;
|
|
};
|
|
} // namespace dht
|
|
} // namespace llarp
|
|
#endif
|