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
437
437
UniValue
438
438
name_show (const JSONRPCRequest& request)
439
439
{
440
+ bool allow_expired = DEFAULT_ALLOWEXPIRED;
441
+
440
442
NameOptionsHelp optHelp;
441
443
optHelp
442
444
.withNameEncoding ()
@@ -483,7 +485,15 @@ name_show (const JSONRPCRequest& request)
483
485
484
486
MaybeWalletForRequest wallet (request);
485
487
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;
487
497
}
488
498
489
499
/* ************************************************************************** */
Original file line number Diff line number Diff line change 13
13
#include < string>
14
14
#include < vector>
15
15
16
+ /* * Default value for the -allowexpired argument. */
17
+ static constexpr bool DEFAULT_ALLOWEXPIRED = true ;
18
+
16
19
class CNameData ;
17
20
class COutPoint ;
18
21
class CScript ;
You can’t perform that action at this time.
0 commit comments