|
|
|
@ -12,7 +12,7 @@
@@ -12,7 +12,7 @@
|
|
|
|
|
#include "net.h" |
|
|
|
|
#include "netbase.h" |
|
|
|
|
#include "policy/rbf.h" |
|
|
|
|
#include "rpcserver.h" |
|
|
|
|
#include "rpc/server.h" |
|
|
|
|
#include "timedata.h" |
|
|
|
|
#include "util.h" |
|
|
|
|
#include "utilmoneystr.h" |
|
|
|
@ -110,7 +110,7 @@ UniValue getnewaddress(const UniValue& params, bool fHelp)
@@ -110,7 +110,7 @@ UniValue getnewaddress(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getnewaddress ( \"account\" )\n" |
|
|
|
@ -188,7 +188,7 @@ UniValue getaccountaddress(const UniValue& params, bool fHelp)
@@ -188,7 +188,7 @@ UniValue getaccountaddress(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() != 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getaccountaddress \"account\"\n" |
|
|
|
@ -220,7 +220,7 @@ UniValue getrawchangeaddress(const UniValue& params, bool fHelp)
@@ -220,7 +220,7 @@ UniValue getrawchangeaddress(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getrawchangeaddress\n" |
|
|
|
@ -255,7 +255,7 @@ UniValue setaccount(const UniValue& params, bool fHelp)
@@ -255,7 +255,7 @@ UniValue setaccount(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 1 || params.size() > 2) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"setaccount \"bitcoinaddress\" \"account\"\n" |
|
|
|
@ -301,7 +301,7 @@ UniValue getaccount(const UniValue& params, bool fHelp)
@@ -301,7 +301,7 @@ UniValue getaccount(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() != 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getaccount \"bitcoinaddress\"\n" |
|
|
|
@ -333,7 +333,7 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp)
@@ -333,7 +333,7 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() != 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getaddressesbyaccount \"account\"\n" |
|
|
|
@ -401,7 +401,7 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp)
@@ -401,7 +401,7 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 2 || params.size() > 5) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"sendtoaddress \"bitcoinaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount )\n" |
|
|
|
@ -459,7 +459,7 @@ UniValue listaddressgroupings(const UniValue& params, bool fHelp)
@@ -459,7 +459,7 @@ UniValue listaddressgroupings(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listaddressgroupings\n" |
|
|
|
@ -510,7 +510,7 @@ UniValue signmessage(const UniValue& params, bool fHelp)
@@ -510,7 +510,7 @@ UniValue signmessage(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() != 2) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"signmessage \"bitcoinaddress\" \"message\"\n" |
|
|
|
@ -566,7 +566,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
@@ -566,7 +566,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 1 || params.size() > 2) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getreceivedbyaddress \"bitcoinaddress\" ( minconf )\n" |
|
|
|
@ -624,7 +624,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
@@ -624,7 +624,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 1 || params.size() > 2) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getreceivedbyaccount \"account\" ( minconf )\n" |
|
|
|
@ -713,7 +713,7 @@ UniValue getbalance(const UniValue& params, bool fHelp)
@@ -713,7 +713,7 @@ UniValue getbalance(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 3) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getbalance ( \"account\" minconf includeWatchonly )\n" |
|
|
|
@ -788,7 +788,7 @@ UniValue getunconfirmedbalance(const UniValue ¶ms, bool fHelp)
@@ -788,7 +788,7 @@ UniValue getunconfirmedbalance(const UniValue ¶ms, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 0) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getunconfirmedbalance\n" |
|
|
|
@ -804,7 +804,7 @@ UniValue movecmd(const UniValue& params, bool fHelp)
@@ -804,7 +804,7 @@ UniValue movecmd(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 3 || params.size() > 5) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n" |
|
|
|
@ -877,7 +877,7 @@ UniValue sendfrom(const UniValue& params, bool fHelp)
@@ -877,7 +877,7 @@ UniValue sendfrom(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 3 || params.size() > 6) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"sendfrom \"fromaccount\" \"tobitcoinaddress\" amount ( minconf \"comment\" \"comment-to\" )\n" |
|
|
|
@ -941,7 +941,7 @@ UniValue sendmany(const UniValue& params, bool fHelp)
@@ -941,7 +941,7 @@ UniValue sendmany(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 2 || params.size() > 5) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] )\n" |
|
|
|
@ -1048,14 +1048,14 @@ UniValue sendmany(const UniValue& params, bool fHelp)
@@ -1048,14 +1048,14 @@ UniValue sendmany(const UniValue& params, bool fHelp)
|
|
|
|
|
return wtx.GetHash().GetHex(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Defined in rpcmisc.cpp
|
|
|
|
|
// Defined in rpc/misc.cpp
|
|
|
|
|
extern CScript _createmultisig_redeemScript(const UniValue& params); |
|
|
|
|
|
|
|
|
|
UniValue addmultisigaddress(const UniValue& params, bool fHelp) |
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 2 || params.size() > 3) |
|
|
|
|
{ |
|
|
|
|
string msg = "addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n" |
|
|
|
@ -1238,7 +1238,7 @@ UniValue listreceivedbyaddress(const UniValue& params, bool fHelp)
@@ -1238,7 +1238,7 @@ UniValue listreceivedbyaddress(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 3) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listreceivedbyaddress ( minconf includeempty includeWatchonly)\n" |
|
|
|
@ -1276,7 +1276,7 @@ UniValue listreceivedbyaccount(const UniValue& params, bool fHelp)
@@ -1276,7 +1276,7 @@ UniValue listreceivedbyaccount(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 3) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listreceivedbyaccount ( minconf includeempty includeWatchonly)\n" |
|
|
|
@ -1411,7 +1411,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp)
@@ -1411,7 +1411,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 4) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listtransactions ( \"account\" count from includeWatchonly)\n" |
|
|
|
@ -1537,7 +1537,7 @@ UniValue listaccounts(const UniValue& params, bool fHelp)
@@ -1537,7 +1537,7 @@ UniValue listaccounts(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 2) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listaccounts ( minconf includeWatchonly)\n" |
|
|
|
@ -1616,7 +1616,7 @@ UniValue listsinceblock(const UniValue& params, bool fHelp)
@@ -1616,7 +1616,7 @@ UniValue listsinceblock(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listsinceblock ( \"blockhash\" target-confirmations includeWatchonly)\n" |
|
|
|
@ -1708,7 +1708,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp)
@@ -1708,7 +1708,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 1 || params.size() > 2) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"gettransaction \"txid\" ( includeWatchonly )\n" |
|
|
|
@ -1823,7 +1823,7 @@ UniValue backupwallet(const UniValue& params, bool fHelp)
@@ -1823,7 +1823,7 @@ UniValue backupwallet(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() != 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"backupwallet \"destination\"\n" |
|
|
|
@ -1849,7 +1849,7 @@ UniValue keypoolrefill(const UniValue& params, bool fHelp)
@@ -1849,7 +1849,7 @@ UniValue keypoolrefill(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"keypoolrefill ( newsize )\n" |
|
|
|
@ -1893,7 +1893,7 @@ UniValue walletpassphrase(const UniValue& params, bool fHelp)
@@ -1893,7 +1893,7 @@ UniValue walletpassphrase(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2)) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"walletpassphrase \"passphrase\" timeout\n" |
|
|
|
@ -1953,7 +1953,7 @@ UniValue walletpassphrasechange(const UniValue& params, bool fHelp)
@@ -1953,7 +1953,7 @@ UniValue walletpassphrasechange(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2)) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n" |
|
|
|
@ -1999,7 +1999,7 @@ UniValue walletlock(const UniValue& params, bool fHelp)
@@ -1999,7 +1999,7 @@ UniValue walletlock(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0)) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"walletlock\n" |
|
|
|
@ -2038,7 +2038,7 @@ UniValue encryptwallet(const UniValue& params, bool fHelp)
@@ -2038,7 +2038,7 @@ UniValue encryptwallet(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1)) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"encryptwallet \"passphrase\"\n" |
|
|
|
@ -2095,7 +2095,7 @@ UniValue lockunspent(const UniValue& params, bool fHelp)
@@ -2095,7 +2095,7 @@ UniValue lockunspent(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 1 || params.size() > 2) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"lockunspent unlock [{\"txid\":\"txid\",\"vout\":n},...]\n" |
|
|
|
@ -2179,7 +2179,7 @@ UniValue listlockunspent(const UniValue& params, bool fHelp)
@@ -2179,7 +2179,7 @@ UniValue listlockunspent(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 0) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listlockunspent\n" |
|
|
|
@ -2228,7 +2228,7 @@ UniValue settxfee(const UniValue& params, bool fHelp)
@@ -2228,7 +2228,7 @@ UniValue settxfee(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() < 1 || params.size() > 1) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"settxfee amount\n" |
|
|
|
@ -2255,7 +2255,7 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp)
@@ -2255,7 +2255,7 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() != 0) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"getwalletinfo\n" |
|
|
|
@ -2297,7 +2297,7 @@ UniValue resendwallettransactions(const UniValue& params, bool fHelp)
@@ -2297,7 +2297,7 @@ UniValue resendwallettransactions(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() != 0) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"resendwallettransactions\n" |
|
|
|
@ -2322,7 +2322,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
@@ -2322,7 +2322,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
|
|
|
|
|
{ |
|
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
|
|
return NullUniValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fHelp || params.size() > 3) |
|
|
|
|
throw runtime_error( |
|
|
|
|
"listunspent ( minconf maxconf [\"address\",...] )\n" |
|
|
|
|