aboutsummaryrefslogtreecommitdiff
path: root/src/node/connection_types.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2021-12-01 19:11:37 +0000
committerdergoegge <n.goeggi@gmail.com>2022-07-06 18:13:53 +0200
commitc741d748d4d9836940b99091cc7be09c65efcb79 (patch)
treeee014d0d430cda11f42298366865c78e22b839da /src/node/connection_types.cpp
parenta3c27070396ab8c2941c437e8099547e8fc9c110 (diff)
downloadbitcoin-c741d748d4d9836940b99091cc7be09c65efcb79.tar.xz
[net] Move ConnectionType to its own file
Diffstat (limited to 'src/node/connection_types.cpp')
-rw-r--r--src/node/connection_types.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/node/connection_types.cpp b/src/node/connection_types.cpp
new file mode 100644
index 0000000000..904f4371aa
--- /dev/null
+++ b/src/node/connection_types.cpp
@@ -0,0 +1,26 @@
+// Copyright (c) 2022 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#include <node/connection_types.h>
+#include <cassert>
+
+std::string ConnectionTypeAsString(ConnectionType conn_type)
+{
+ switch (conn_type) {
+ case ConnectionType::INBOUND:
+ return "inbound";
+ case ConnectionType::MANUAL:
+ return "manual";
+ case ConnectionType::FEELER:
+ return "feeler";
+ case ConnectionType::OUTBOUND_FULL_RELAY:
+ return "outbound-full-relay";
+ case ConnectionType::BLOCK_RELAY:
+ return "block-relay-only";
+ case ConnectionType::ADDR_FETCH:
+ return "addr-fetch";
+ } // no default case, so the compiler can warn about missing cases
+
+ assert(false);
+}