mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user