@@ -237,15 +237,19 @@ UniValue ListaddressesForPurpose(const std::string strPurpose)
237237
238238UniValue listdelegators (const UniValue& params, bool fHelp )
239239{
240- if (fHelp || params.size () != 0 )
240+ if (fHelp || params.size () > 1 )
241241 throw std::runtime_error (
242- " listdelegators \" addr \" \n"
242+ " listdelegators ( fBlacklist ) \n "
243243 " \n Shows the list of allowed delegator addresses for cold staking.\n "
244244
245+ " \n Arguments:\n "
246+ " 1. fBlacklist (boolean, optional, default = false) Show addresses removed\n "
247+ " from the delegators whitelist\n "
248+
245249 " \n Result:\n "
246250 " [\n "
247251 " {\n "
248- " \" label\" : \" yyy\" , (string) account label\n "
252+ " \" label\" : \" yyy\" , (string) account label\n "
249253 " \" address\" : \" xxx\" , (string) PIVX address string\n "
250254 " }\n "
251255 " ...\n "
@@ -255,7 +259,10 @@ UniValue listdelegators(const UniValue& params, bool fHelp)
255259 HelpExampleCli (" listdelegators" , " " ) +
256260 HelpExampleRpc (" listdelegators" , " " ));
257261
258- return ListaddressesForPurpose (" delegator" );
262+ const bool fBlacklist = (params.size () > 0 ? params[0 ].get_bool () : false );
263+ return (fBlacklist ?
264+ ListaddressesForPurpose (AddressBook::AddressBookPurpose::DELEGABLE) :
265+ ListaddressesForPurpose (AddressBook::AddressBookPurpose::DELEGATOR));
259266}
260267
261268UniValue liststakingaddresses (const UniValue& params, bool fHelp )
0 commit comments