From 4357158c4712d479522d5cd441ad4dd1693fdd05 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 13 Feb 2024 13:25:59 +0100 Subject: wallet: return and display signer error Both RPC and GUI now render a useful error message instead of (silently) failing. Replace bool with util::Result to clarify that this either succeeds or returns an error message. --- src/wallet/rpc/addresses.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/wallet/rpc/addresses.cpp') diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp index 7f068c05ef..bed9ec029a 100644 --- a/src/wallet/rpc/addresses.cpp +++ b/src/wallet/rpc/addresses.cpp @@ -789,9 +789,8 @@ RPCHelpMan walletdisplayaddress() throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address"); } - if (!pwallet->DisplayAddress(dest)) { - throw JSONRPCError(RPC_MISC_ERROR, "Failed to display address"); - } + util::Result res = pwallet->DisplayAddress(dest); + if (!res) throw JSONRPCError(RPC_MISC_ERROR, util::ErrorString(res).original); UniValue result(UniValue::VOBJ); result.pushKV("address", request.params[0].get_str()); -- cgit v1.2.3