@@ -95,7 +95,8 @@ static RPCHelpMan ping()
9595
9696static RPCHelpMan getpeerinfo ()
9797{
98- return RPCHelpMan{" getpeerinfo" ,
98+ return RPCHelpMan{
99+ " getpeerinfo" ,
99100 " \n Returns data about each connected network node as a json array of objects.\n " ,
100101 {},
101102 RPCResult{
@@ -140,16 +141,16 @@ static RPCHelpMan getpeerinfo()
140141 {RPCResult::Type::BOOL, " bip152_hb_from" , " Whether peer selected us as (compact blocks) high-bandwidth peer" },
141142 {RPCResult::Type::BOOL, " masternode" , " Whether connection was due to masternode connection attempt" },
142143 {RPCResult::Type::NUM, " banscore" , " The ban score (DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed)" },
143- {RPCResult::Type::NUM, " startingheight" , " The starting height (block) of the peer" },
144- {RPCResult::Type::NUM, " synced_headers" , " The last header we have in common with this peer" },
145- {RPCResult::Type::NUM, " synced_blocks" , " The last block we have in common with this peer" },
146- {RPCResult::Type::ARR, " inflight" , " " ,
144+ {RPCResult::Type::NUM, " startingheight" , /* optional= */ true , " The starting height (block) of the peer" },
145+ {RPCResult::Type::NUM, " synced_headers" , /* optional= */ true , " The last header we have in common with this peer" },
146+ {RPCResult::Type::NUM, " synced_blocks" , /* optional= */ true , " The last block we have in common with this peer" },
147+ {RPCResult::Type::ARR, " inflight" , /* optional= */ true , " " ,
147148 {
148149 {RPCResult::Type::NUM, " n" , " The heights of blocks we're currently asking from this peer" },
149150 }},
150- {RPCResult::Type::BOOL, " addr_relay_enabled" , " Whether we participate in address relay with this peer" },
151- {RPCResult::Type::NUM, " addr_processed" , " The total number of addresses processed, excluding those dropped due to rate limiting" },
152- {RPCResult::Type::NUM, " addr_rate_limited" , " The total number of addresses dropped due to rate limiting" },
151+ {RPCResult::Type::BOOL, " addr_relay_enabled" , /* optional= */ true , " Whether we participate in address relay with this peer" },
152+ {RPCResult::Type::NUM, " addr_processed" , /* optional= */ true , " The total number of addresses processed, excluding those dropped due to rate limiting" },
153+ {RPCResult::Type::NUM, " addr_rate_limited" , /* optional= */ true , " The total number of addresses dropped due to rate limiting" },
153154 {RPCResult::Type::ARR, " permissions" , " Any special permissions that have been granted to this peer" ,
154155 {
155156 {RPCResult::Type::STR, " permission_type" , Join (NET_PERMISSIONS_DOC, " ,\n " ) + " .\n " },
@@ -167,15 +168,16 @@ static RPCHelpMan getpeerinfo()
167168 " Only known message types can appear as keys in the object and all bytes received of unknown message types are listed under '" +NET_MESSAGE_TYPE_OTHER+" '." }
168169 }},
169170 {RPCResult::Type::STR, " connection_type" , " Type of connection: \n " + Join (CONNECTION_TYPE_DOC, " ,\n " ) + " .\n "
170- " Please note this output is unlikely to be stable in upcoming releases as we iterate to\n "
171- " best capture connection behaviors." },
171+ " Please note this output is unlikely to be stable in upcoming releases as we iterate to\n "
172+ " best capture connection behaviors." },
172173 {RPCResult::Type::STR, " transport_protocol_type" , " Type of transport protocol: \n " + Join (TRANSPORT_TYPE_DOC, " ,\n " ) + " .\n " },
173174 {RPCResult::Type::STR, " session_id" , " The session ID for this connection, or \"\" if there is none (\" v2\" transport protocol only).\n " },
174175 }},
175- }}},
176+ }},
177+ },
176178 RPCExamples{
177179 HelpExampleCli (" getpeerinfo" , " " )
178- + HelpExampleRpc (" getpeerinfo" , " " )
180+ + HelpExampleRpc (" getpeerinfo" , " " )
179181 },
180182 [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
181183{
0 commit comments