diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index e0e4b2a162..716f60dc04 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -49,6 +49,7 @@ static UniValue validateaddress(const JSONRPCRequest& request) "\nResult:\n" "{\n" " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n" + " \"isvalid_parent\" : true|false (boolean) If the address is valid or not for parent chain. Valid or not, no additional details will be appended unlike `isvalid`.\n" " \"address\" : \"address\", (string) The bitcoin address validated\n" " \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n" " \"isscript\" : true|false, (boolean) If the key is a script\n" @@ -62,10 +63,12 @@ static UniValue validateaddress(const JSONRPCRequest& request) ); CTxDestination dest = DecodeDestination(request.params[0].get_str()); + CTxDestination parent_dest = DecodeParentDestination(request.params[0].get_str()); bool isValid = IsValidDestination(dest); - + bool is_valid_parent = IsValidDestination(parent_dest); UniValue ret(UniValue::VOBJ); ret.pushKV("isvalid", isValid); + ret.pushKV("isvalid_parent", is_valid_parent); if (isValid) {