update rpc section

This commit is contained in:
Michel van Kessel
2020-12-20 15:57:32 +01:00
parent 5352e77696
commit 597a77892d
8 changed files with 201 additions and 191 deletions

View File

@@ -3,20 +3,21 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
#include "clientversion.h"
#include "dstencode.h"
#include "init.h"
#include "main.h"
#include "net.h"
#include "netbase.h"
#include "rpc/server.h"
#include "timedata.h"
#include "util.h"
#include "utilstrencodings.h"
#include <base58.h>
#include <clientversion.h>
#include <dstencode.h>
#include <init.h>
#include <main.h>
#include <net.h>
#include <netbase.h>
#include <rpc/server.h>
#include <timedata.h>
#include <txmempool.h>
#include <util.h>
#include <utilstrencodings.h>
#ifdef ENABLE_WALLET
#include "wallet/wallet.h"
#include "wallet/walletdb.h"
#include <wallet/wallet.h>
#include <wallet/walletdb.h>
#endif
#include <stdint.h>
@@ -45,7 +46,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 0)
throw runtime_error(
"getinfo\n"
"\nDEPRECATED. Returns an object containing various state info.\n"
"Returns an object containing various state info.\n"
"\nResult:\n"
"{\n"
" \"version\": xxxxx, (numeric) the server version\n"
@@ -74,7 +75,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
);
#ifdef ENABLE_WALLET
LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL);
LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : nullptr);
#else
LOCK(cs_main);
#endif
@@ -160,14 +161,14 @@ UniValue validateaddress(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"validateaddress \"bitcoinaddress\"\n"
"\nReturn information about the given bitcoin address.\n"
"validateaddress \"blackcoinaddress\"\n"
"\nReturn information about the given blackcoin address.\n"
"\nArguments:\n"
"1. \"bitcoinaddress\" (string, required) The bitcoin address to validate\n"
"1. \"blackcoinaddress\" (string, required) The blackcoin address to validate\n"
"\nResult:\n"
"{\n"
" \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n"
" \"address\" : \"bitcoinaddress\", (string) The bitcoin address validated\n"
" \"address\" : \"blackcoinaddress\", (string) The blackcoin address validated\n"
" \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n"
" \"ismine\" : true|false, (boolean) If the address is yours or not\n"
" \"iswatchonly\" : true|false, (boolean) If the address is watchonly\n"
@@ -179,12 +180,12 @@ UniValue validateaddress(const UniValue& params, bool fHelp)
" \"hdmasterkeyid\" : \"<hash160>\" (string, optional) The Hash160 of the HD master pubkey\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
+ HelpExampleRpc("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
+ HelpExampleCli("validateaddress", "\"BPSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
+ HelpExampleRpc("validateaddress", "\"BPSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
);
#ifdef ENABLE_WALLET
LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL);
LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : nullptr);
#else
LOCK(cs_main);
#endif
@@ -305,9 +306,9 @@ UniValue createmultisig(const UniValue& params, bool fHelp)
"\nArguments:\n"
"1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n"
"2. \"keys\" (string, required) A json array of keys which are bitcoin addresses or hex-encoded public keys\n"
"2. \"keys\" (string, required) A json array of keys which are blackcoin addresses or hex-encoded public keys\n"
" [\n"
" \"key\" (string) bitcoin address or hex-encoded public key\n"
" \"key\" (string) blackcoin address or hex-encoded public key\n"
" ,...\n"
" ]\n"
@@ -319,9 +320,9 @@ UniValue createmultisig(const UniValue& params, bool fHelp)
"\nExamples:\n"
"\nCreate a multisig address from 2 addresses\n"
+ HelpExampleCli("createmultisig", "2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
+ HelpExampleCli("createmultisig", "2 \"[\\\"B6sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"B71sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
"\nAs a json rpc call\n"
+ HelpExampleRpc("createmultisig", "2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
+ HelpExampleRpc("createmultisig", "2, \"[\\\"B6sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"B71sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
;
throw runtime_error(msg);
}
@@ -459,7 +460,7 @@ UniValue setmocktime(const UniValue& params, bool fHelp)
SetMockTime(params[0].get_int64());
uint64_t t = GetTime();
BOOST_FOREACH(CNode* pnode, vNodes) {
for(CNode* pnode: vNodes) {
pnode->nLastSend = pnode->nLastRecv = t;
}