From e526b3d34c20cd723b08252638d10a7584b697cb Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Mon, 17 Jul 2017 05:42:30 -0400 Subject: Fix misleading "Method not found" multiwallet errors Raise RPC_WALLET_NOT_SPECIFIED instead of RPC_METHOD_NOT_FOUND when a required wallet filename was not specified in an RPC call. Also raise more specific RPC_WALLET_NOT_FOUND error instead of RPC_INVALID_PARAMETER in case an invalid wallet was specified, for consistency. --- src/bitcoin-cli.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/bitcoin-cli.cpp') diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 445b9d8e89..c1a7c927e3 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -337,6 +337,10 @@ int CommandLineRPC(int argc, char *argv[]) if (errMsg.isStr()) strPrint += "error message:\n"+errMsg.get_str(); + + if (errCode.isNum() && errCode.get_int() == RPC_WALLET_NOT_SPECIFIED) { + strPrint += "\nTry adding \"-rpcwallet=\" option to bitcoin-cli command line."; + } } } else { // Result -- cgit v1.2.3