---
title: llarp/dht/messages/gotintro.hpp

---

# llarp/dht/messages/gotintro.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::dht](Namespaces/namespacellarp_1_1dht.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::dht::GotIntroMessage](Classes/structllarp_1_1dht_1_1GotIntroMessage.md)** <br>acknowledgement to [PublishIntroMessage]() or reply to [FindIntroMessage](Classes/structllarp_1_1dht_1_1FindIntroMessage.md) |
| struct | **[llarp::dht::RelayedGotIntroMessage](Classes/structllarp_1_1dht_1_1RelayedGotIntroMessage.md)**  |




## Source code

```cpp
#pragma once

#include <llarp/dht/message.hpp>
#include <llarp/service/intro_set.hpp>
#include <llarp/util/copy_or_nullptr.hpp>

#include <vector>
#include <optional>

namespace llarp
{
  namespace dht
  {
    struct GotIntroMessage : public IMessage
    {
      std::vector<service::EncryptedIntroSet> found;
      uint64_t txid = 0;
      std::optional<Key_t> closer;

      GotIntroMessage(const Key_t& from) : IMessage(from)
      {}

      GotIntroMessage(const GotIntroMessage& other)
          : IMessage(other.From), found(other.found), txid(other.txid), closer(other.closer)
      {
        version = other.version;
      }

      GotIntroMessage(const Key_t& from, const Key_t& _closer, uint64_t _txid)
          : IMessage(from), txid(_txid), closer(_closer)
      {}

      GotIntroMessage(std::vector<service::EncryptedIntroSet> results, uint64_t txid);

      ~GotIntroMessage() override = default;

      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<IMessage::Ptr_t>& replies) const override;
    };

    struct RelayedGotIntroMessage final : public GotIntroMessage
    {
      RelayedGotIntroMessage() : GotIntroMessage({})
      {}

      bool
      HandleMessage(llarp_dht_context* ctx, std::vector<IMessage::Ptr_t>& replies) const override;
    };

    using GotIntroMessage_constptr = std::shared_ptr<const GotIntroMessage>;
  }  // namespace dht
}  // namespace llarp
```


-------------------------------

Updated on 2023-01-27 at 23:09:26 +0000
