Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2022-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#include <node/connection_types.h>6#include <cassert>8std::string ConnectionTypeAsString(ConnectionType conn_type)9{10switch (conn_type) {11case ConnectionType::INBOUND:12return "inbound";13case ConnectionType::MANUAL:14return "manual";15case ConnectionType::FEELER:16return "feeler";17case ConnectionType::OUTBOUND_FULL_RELAY:18return "outbound-full-relay";19case ConnectionType::BLOCK_RELAY:20return "block-relay-only";21case ConnectionType::ADDR_FETCH:22return "addr-fetch";23case ConnectionType::PRIVATE_BROADCAST:24return "private-broadcast";25} // no default case, so the compiler can warn about missing cases27assert(false);28}30std::string TransportTypeAsString(TransportProtocolType transport_type)31{32switch (transport_type) {33case TransportProtocolType::DETECTING:34return "detecting";35case TransportProtocolType::V1:36return "v1";37case TransportProtocolType::V2:38return "v2";39} // no default case, so the compiler can warn about missing cases41assert(false);42}