Line data Source code
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 <node/connection_types.h> 6 : #include <cassert> 7 : 8 0 : std::string ConnectionTypeAsString(ConnectionType conn_type) 9 : { 10 0 : switch (conn_type) { 11 : case ConnectionType::INBOUND: 12 0 : return "inbound"; 13 : case ConnectionType::MANUAL: 14 0 : return "manual"; 15 : case ConnectionType::FEELER: 16 0 : return "feeler"; 17 : case ConnectionType::OUTBOUND_FULL_RELAY: 18 0 : return "outbound-full-relay"; 19 : case ConnectionType::BLOCK_RELAY: 20 0 : return "block-relay-only"; 21 : case ConnectionType::ADDR_FETCH: 22 0 : return "addr-fetch"; 23 : } // no default case, so the compiler can warn about missing cases 24 : 25 0 : assert(false); 26 0 : }