File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -863,15 +863,11 @@ static RPCHelpMan getnodeaddresses()
863
863
throw JSONRPCError (RPC_CLIENT_P2P_DISABLED, " Error: Peer-to-peer functionality missing or disabled" );
864
864
}
865
865
866
- int count = 1 ;
867
- if (!request.params [0 ].isNull ()) {
868
- count = request.params [0 ].get_int ();
869
- if (count < 0 ) {
870
- throw JSONRPCError (RPC_INVALID_PARAMETER, " Address count out of range" );
871
- }
872
- }
866
+ const int count{request.params [0 ].isNull () ? 1 : request.params [0 ].get_int ()};
867
+ if (count < 0 ) throw JSONRPCError (RPC_INVALID_PARAMETER, " Address count out of range" );
868
+
873
869
// returns a shuffled list of CAddress
874
- std::vector<CAddress> vAddr = node.connman ->GetAddresses (count, /* max_pct */ 0 );
870
+ const std::vector<CAddress> vAddr{ node.connman ->GetAddresses (count, /* max_pct */ 0 )} ;
875
871
UniValue ret (UniValue::VARR);
876
872
877
873
for (const CAddress& addr : vAddr) {
You can’t perform that action at this time.
0 commit comments