Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
node
connection_types.cpp
Go to the documentation of this file.
1
// Copyright (c) 2022-present 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
std::string
ConnectionTypeAsString
(
ConnectionType
conn_type)
9
{
10
switch
(conn_type) {
11
case
ConnectionType::INBOUND
:
12
return
"inbound"
;
13
case
ConnectionType::MANUAL
:
14
return
"manual"
;
15
case
ConnectionType::FEELER
:
16
return
"feeler"
;
17
case
ConnectionType::OUTBOUND_FULL_RELAY
:
18
return
"outbound-full-relay"
;
19
case
ConnectionType::BLOCK_RELAY
:
20
return
"block-relay-only"
;
21
case
ConnectionType::ADDR_FETCH
:
22
return
"addr-fetch"
;
23
case
ConnectionType::PRIVATE_BROADCAST
:
24
return
"private-broadcast"
;
25
}
// no default case, so the compiler can warn about missing cases
26
27
assert
(
false
);
28
}
29
30
std::string
TransportTypeAsString
(
TransportProtocolType
transport_type)
31
{
32
switch
(transport_type) {
33
case
TransportProtocolType::DETECTING
:
34
return
"detecting"
;
35
case
TransportProtocolType::V1
:
36
return
"v1"
;
37
case
TransportProtocolType::V2
:
38
return
"v2"
;
39
}
// no default case, so the compiler can warn about missing cases
40
41
assert
(
false
);
42
}
TransportTypeAsString
std::string TransportTypeAsString(TransportProtocolType transport_type)
Convert TransportProtocolType enum to a string value.
Definition
connection_types.cpp:30
ConnectionTypeAsString
std::string ConnectionTypeAsString(ConnectionType conn_type)
Convert ConnectionType enum to a string value.
Definition
connection_types.cpp:8
connection_types.h
ConnectionType
ConnectionType
Different types of connections to a peer.
Definition
connection_types.h:18
ConnectionType::PRIVATE_BROADCAST
@ PRIVATE_BROADCAST
Private broadcast connections are short-lived and only opened to privacy networks (Tor,...
Definition
connection_types.h:84
ConnectionType::BLOCK_RELAY
@ BLOCK_RELAY
We use block-relay-only connections to help prevent against partition attacks.
Definition
connection_types.h:69
ConnectionType::MANUAL
@ MANUAL
We open manual connections to addresses that users explicitly requested via the addnode RPC or the -a...
Definition
connection_types.h:41
ConnectionType::OUTBOUND_FULL_RELAY
@ OUTBOUND_FULL_RELAY
These are the default connections that we use to connect with the network.
Definition
connection_types.h:32
ConnectionType::FEELER
@ FEELER
Feeler connections are short-lived connections made to check that a node is alive.
Definition
connection_types.h:58
ConnectionType::INBOUND
@ INBOUND
Inbound connections are those initiated by a peer.
Definition
connection_types.h:24
ConnectionType::ADDR_FETCH
@ ADDR_FETCH
AddrFetch connections are short lived connections used to solicit addresses from peers.
Definition
connection_types.h:77
TransportProtocolType
TransportProtocolType
Transport layer version.
Definition
connection_types.h:91
TransportProtocolType::V1
@ V1
Unencrypted, plaintext protocol.
Definition
connection_types.h:93
TransportProtocolType::V2
@ V2
BIP324 protocol.
Definition
connection_types.h:94
TransportProtocolType::DETECTING
@ DETECTING
Peer could be v1 or v2.
Definition
connection_types.h:92
assert
assert(!tx.IsCoinBase())
Generated on
for Bitcoin Core by
1.17.0