mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
Merge #20090: [doc] Tiny followups to new getpeerinfo connection type field
41dca087b73a3627107603694f5a982ea2a53189 [trivial] Extract connection type doc into file where it is used. (Amiti Uttarwar) 3069b56a456d98fca7c4a4ccd329581bd1f0b853 [doc] Improve help for getpeerinfo connection_type field. (Amiti Uttarwar) Pull request description: two commits addressing small followups from #19725 * first commit adds a clarification in the release notes that this field shouldn't be expected to be stable (suggested by sdaftuar in https://github.com/bitcoin/bitcoin/pull/19725#issuecomment-697421878) * second commit moves the `CONNECTION_TYPE_DOC` object out of the header file to reduce the size of the binary (suggested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/19725#discussion_r495467895, he tested and found a decrease of 10kB) ACKs for top commit: achow101: ACK 41dca087b73a3627107603694f5a982ea2a53189 laanwj: Code review ACK 41dca087b73a3627107603694f5a982ea2a53189 Tree-SHA512: a555df978b4341fbe05deeb40a8a655f0d3c5c1c0adcc1737fd2cf61b204a5a24a301ca0c2b5a3616554d4abf8c57074d22dbda5a50d8450bc22c57679424985
This commit is contained in:
commit
9ad7cd2887
13
src/net.h
13
src/net.h
@ -115,17 +115,12 @@ struct CSerializedNetMsg
|
|||||||
std::string m_type;
|
std::string m_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::vector<std::string> CONNECTION_TYPE_DOC{
|
|
||||||
"outbound-full-relay (default automatic connections)",
|
|
||||||
"block-relay-only (does not relay transactions or addresses)",
|
|
||||||
"inbound (initiated by the peer)",
|
|
||||||
"manual (added via addnode RPC or -addnode/-connect configuration options)",
|
|
||||||
"addr-fetch (short-lived automatic connection for soliciting addresses)",
|
|
||||||
"feeler (short-lived automatic connection for testing addresses)"};
|
|
||||||
|
|
||||||
/** Different types of connections to a peer. This enum encapsulates the
|
/** Different types of connections to a peer. This enum encapsulates the
|
||||||
* information we have available at the time of opening or accepting the
|
* information we have available at the time of opening or accepting the
|
||||||
* connection. Aside from INBOUND, all types are initiated by us. */
|
* connection. Aside from INBOUND, all types are initiated by us.
|
||||||
|
*
|
||||||
|
* If adding or removing types, please update CONNECTION_TYPE_DOC in
|
||||||
|
* src/rpc/net.cpp. */
|
||||||
enum class ConnectionType {
|
enum class ConnectionType {
|
||||||
/**
|
/**
|
||||||
* Inbound connections are those initiated by a peer. This is the only
|
* Inbound connections are those initiated by a peer. This is the only
|
||||||
|
@ -29,6 +29,15 @@
|
|||||||
|
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
|
const std::vector<std::string> CONNECTION_TYPE_DOC{
|
||||||
|
"outbound-full-relay (default automatic connections)",
|
||||||
|
"block-relay-only (does not relay transactions or addresses)",
|
||||||
|
"inbound (initiated by the peer)",
|
||||||
|
"manual (added via addnode RPC or -addnode/-connect configuration options)",
|
||||||
|
"addr-fetch (short-lived automatic connection for soliciting addresses)",
|
||||||
|
"feeler (short-lived automatic connection for testing addresses)"
|
||||||
|
};
|
||||||
|
|
||||||
static RPCHelpMan getconnectioncount()
|
static RPCHelpMan getconnectioncount()
|
||||||
{
|
{
|
||||||
return RPCHelpMan{"getconnectioncount",
|
return RPCHelpMan{"getconnectioncount",
|
||||||
@ -119,7 +128,9 @@ static RPCHelpMan getpeerinfo()
|
|||||||
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
|
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
|
||||||
{RPCResult::Type::BOOL, "addnode", "Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\n"
|
{RPCResult::Type::BOOL, "addnode", "Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\n"
|
||||||
"(DEPRECATED, returned only if the config option -deprecatedrpc=getpeerinfo_addnode is passed)"},
|
"(DEPRECATED, returned only if the config option -deprecatedrpc=getpeerinfo_addnode is passed)"},
|
||||||
{RPCResult::Type::STR, "connection_type", "Type of connection: \n" + Join(CONNECTION_TYPE_DOC, ",\n") + "."},
|
{RPCResult::Type::STR, "connection_type", "Type of connection: \n" + Join(CONNECTION_TYPE_DOC, ",\n") + ".\n"
|
||||||
|
"Please note this output is unlikely to be stable in upcoming releases as we iterate to\n"
|
||||||
|
"best capture connection behaviors."},
|
||||||
{RPCResult::Type::NUM, "startingheight", "The starting height (block) of the peer"},
|
{RPCResult::Type::NUM, "startingheight", "The starting height (block) of the peer"},
|
||||||
{RPCResult::Type::NUM, "banscore", "The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed)"},
|
{RPCResult::Type::NUM, "banscore", "The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed)"},
|
||||||
{RPCResult::Type::NUM, "synced_headers", "The last header we have in common with this peer"},
|
{RPCResult::Type::NUM, "synced_headers", "The last header we have in common with this peer"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user