diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index f76d5591..9116dc29 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -230,15 +230,16 @@ Value dumppubkey(const Array& params, bool fHelp) if (fHelp || params.size() != 1) throw runtime_error( "dumppubkey \n" - "Returns the public key corresponding to ."); + "Returns the public key corresponding to (empty if user doesn't exist)"); string strUsername = params[0].get_str(); CPubKey pubkey; bool gotKey = getUserPubKey(strUsername, pubkey); - if( !gotKey ) - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Username not found"); + if( !gotKey ) { + return ""; + } string strPubkey = string( reinterpret_cast(pubkey.begin()), pubkey.size()); return strPubkey;