mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 03:39:48 +02:00
[wallet] [rpc] Deprecate account RPC methods
All account RPC methods are now deprecated and can only be called if bitcoind has been started with the -deprecatedrpc=accounts switch. Affected RPC methods are: - getaccount - getaccountaddress - getaddressesbyaccount - getreceivedbyaccount - listaccouts - listreceivedbyaccount - move - setaccount
This commit is contained in:
@@ -206,6 +206,13 @@ UniValue getlabeladdress(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts") && request.strMethod == "getaccountaddress") {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("getaccountaddress (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "getaccountaddress is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
|
||||
throw std::runtime_error(
|
||||
"getlabeladdress \"label\" ( force ) \n"
|
||||
@@ -306,6 +313,13 @@ UniValue setlabel(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts") && request.strMethod == "setaccount") {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("setaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "setaccount is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() != 2)
|
||||
throw std::runtime_error(
|
||||
"setlabel \"address\" \"label\"\n"
|
||||
@@ -353,6 +367,13 @@ UniValue getaccount(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts")) {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("getaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "getaccount is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() != 1)
|
||||
throw std::runtime_error(
|
||||
"getaccount \"address\"\n"
|
||||
@@ -389,6 +410,13 @@ UniValue getaddressesbyaccount(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts")) {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("getaddressbyaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "getaddressesbyaccount is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() != 1)
|
||||
throw std::runtime_error(
|
||||
"getaddressesbyaccount \"account\"\n"
|
||||
@@ -744,6 +772,13 @@ UniValue getreceivedbylabel(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts") && request.strMethod == "getreceivedbyaccount") {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("getreceivedbyaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "getreceivedbyaccount is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)
|
||||
throw std::runtime_error(
|
||||
"getreceivedbylabel \"label\" ( minconf )\n"
|
||||
@@ -913,6 +948,13 @@ UniValue movecmd(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts")) {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("move (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "move is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() < 3 || request.params.size() > 5)
|
||||
throw std::runtime_error(
|
||||
"move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n"
|
||||
@@ -1609,6 +1651,13 @@ UniValue listreceivedbylabel(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts") && request.strMethod == "listreceivedbyaccount") {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("listreceivedbyaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "listreceivedbyaccount is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() > 3)
|
||||
throw std::runtime_error(
|
||||
"listreceivedbylabel ( minconf include_empty include_watchonly)\n"
|
||||
@@ -1908,6 +1957,13 @@ UniValue listaccounts(const JSONRPCRequest& request)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("accounts")) {
|
||||
if (request.fHelp) {
|
||||
throw std::runtime_error("listaccounts (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)");
|
||||
}
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "listaccounts is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts.");
|
||||
}
|
||||
|
||||
if (request.fHelp || request.params.size() > 2)
|
||||
throw std::runtime_error(
|
||||
"listaccounts ( minconf include_watchonly)\n"
|
||||
|
||||
Reference in New Issue
Block a user