diff options
| author | Russell Yanofsky <[email protected]> | 2017-07-17 05:42:30 -0400 |
|---|---|---|
| committer | Russell Yanofsky <[email protected]> | 2017-07-26 02:48:15 -0400 |
| commit | e526b3d34c20cd723b08252638d10a7584b697cb (patch) | |
| tree | 21f1193f8cc46dd043cf4acfac0797feac5de192 /src/bitcoin-cli.cpp | |
| parent | Merge #10854: Avoid using sizes on non-fixed-width types to derive protocol c... (diff) | |
| download | discoin-e526b3d34c20cd723b08252638d10a7584b697cb.tar.xz discoin-e526b3d34c20cd723b08252638d10a7584b697cb.zip | |
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.
Diffstat (limited to 'src/bitcoin-cli.cpp')
| -rw-r--r-- | src/bitcoin-cli.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 445b9d8e8..c1a7c927e 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=<filename>\" option to bitcoin-cli command line."; + } } } else { // Result |