Kagome
Polkadot Runtime Engine in C++17
own_peer_info.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_NETWORK_TYPES_OWNPEERINFO
7 #define KAGOME_CORE_NETWORK_TYPES_OWNPEERINFO
8 
9 #include <libp2p/peer/peer_info.hpp>
10 
11 namespace kagome::network {
12 
15  std::vector<libp2p::multi::Multiaddress> public_addrs,
16  std::vector<libp2p::multi::Multiaddress> listen_addrs)
17  : PeerInfo{.id = std::move(peer_id),
18  .addresses = std::move(public_addrs)},
19  listen_addresses{std::move(listen_addrs)} {}
20 
21  bool operator==(const OwnPeerInfo &other) const {
22  return id == other.id && addresses == other.addresses
24  }
25 
26  bool operator!=(const OwnPeerInfo &other) const {
27  return !(*this == other);
28  }
29 
30  std::vector<libp2p::multi::Multiaddress> listen_addresses;
31  };
32 
33 } // namespace kagome::network
34 
35 #endif // KAGOME_CORE_NETWORK_TYPES_OWNPEERINFO
OwnPeerInfo(libp2p::peer::PeerId peer_id, std::vector< libp2p::multi::Multiaddress > public_addrs, std::vector< libp2p::multi::Multiaddress > listen_addrs)
bool operator!=(const OwnPeerInfo &other) const
std::vector< libp2p::multi::Multiaddress > listen_addresses
libp2p::peer::PeerInfo PeerInfo
bool operator==(const OwnPeerInfo &other) const
libp2p::peer::PeerId PeerId