File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,8 @@ namespace
437437UniValue
438438name_show (const JSONRPCRequest& request)
439439{
440+ bool allow_expired = DEFAULT_ALLOWEXPIRED;
441+
440442 NameOptionsHelp optHelp;
441443 optHelp
442444 .withNameEncoding ()
@@ -483,7 +485,15 @@ name_show (const JSONRPCRequest& request)
483485
484486 MaybeWalletForRequest wallet (request);
485487 LOCK2 (wallet.getLock (), cs_main);
486- return getNameInfo (options, name, data, wallet);
488+ UniValue name_object = getNameInfo (options, name, data, wallet);
489+ assert (!name_object[" expired" ].isNull ());
490+ const bool is_expired = name_object[" expired" ].get_bool ();
491+ if (is_expired && !allow_expired) {
492+ std::ostringstream msg;
493+ msg << " name not found: " << EncodeNameForMessage (name);
494+ throw JSONRPCError (RPC_WALLET_ERROR, msg.str ());
495+ }
496+ return name_object;
487497}
488498
489499/* ************************************************************************** */
Original file line number Diff line number Diff line change 1313#include < string>
1414#include < vector>
1515
16+ /* * Default value for the -allowexpired argument. */
17+ static constexpr bool DEFAULT_ALLOWEXPIRED = true ;
18+
1619class CNameData ;
1720class COutPoint ;
1821class CScript ;
You can’t perform that action at this time.
0 commit comments