Bitcoin ABC 0.32.4
P2P Digital Currency
connection_types.cpp
Go to the documentation of this file.
1// Copyright (c) 2022 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <cassert>
7
8std::string ConnectionTypeAsString(ConnectionType conn_type) {
9 switch (conn_type) {
11 return "inbound";
13 return "manual";
15 return "feeler";
17 return "outbound-full-relay";
19 return "block-relay-only";
21 return "addr-fetch";
23 return "avalanche";
24 } // no default case, so the compiler can warn about missing cases
25
26 assert(false);
27}
std::string ConnectionTypeAsString(ConnectionType conn_type)
Convert ConnectionType enum to a string value.
ConnectionType
Different types of connections to a peer.
@ BLOCK_RELAY
We use block-relay-only connections to help prevent against partition attacks.
@ MANUAL
We open manual connections to addresses that users explicitly inputted via the addnode RPC,...
@ OUTBOUND_FULL_RELAY
These are the default connections that we use to connect with the network.
@ FEELER
Feeler connections are short-lived connections made to check that a node is alive.
@ INBOUND
Inbound connections are those initiated by a peer.
@ AVALANCHE_OUTBOUND
Special case of connection to a full relay outbound with avalanche service enabled.
@ ADDR_FETCH
AddrFetch connections are short lived connections used to solicit addresses from peers.
assert(!tx.IsCoinBase())