File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,8 @@ UniValue validateaddress(const UniValue& params, bool fHelp)
166
166
" \" pubkey\" : \" publickeyhex\" , (string) The hex value of the raw public key\n "
167
167
" \" iscompressed\" : true|false, (boolean) If the address is compressed\n "
168
168
" \" account\" : \" account\" (string) DEPRECATED. The account associated with the address, \"\" is the default account\n "
169
+ " \" hdkeypath\" : \" keypath\" (string, optional) The HD keypath if the key is HD and available\n "
170
+ " \" hdmasterkeyid\" : \" <hash160>\" (string, optional) The Hash160 of the HD master pubkey\n "
169
171
" }\n "
170
172
" \n Examples:\n "
171
173
+ HelpExampleCli (" validateaddress" , " \" 1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\" " )
@@ -200,6 +202,12 @@ UniValue validateaddress(const UniValue& params, bool fHelp)
200
202
ret.pushKVs (detail);
201
203
if (pwalletMain && pwalletMain->mapAddressBook .count (dest))
202
204
ret.push_back (Pair (" account" , pwalletMain->mapAddressBook [dest].name ));
205
+ CKeyID keyID;
206
+ if (pwalletMain && address.GetKeyID (keyID) && pwalletMain->mapKeyMetadata .count (keyID) && !pwalletMain->mapKeyMetadata [keyID].hdKeypath .empty ())
207
+ {
208
+ ret.push_back (Pair (" hdkeypath" , pwalletMain->mapKeyMetadata [keyID].hdKeypath ));
209
+ ret.push_back (Pair (" hdmasterkeyid" , pwalletMain->mapKeyMetadata [keyID].hdMasterKeyID .GetHex ()));
210
+ }
203
211
#endif
204
212
}
205
213
return ret;
You can’t perform that action at this time.
0 commit comments