mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
rpcwallet: add 'ischange' field to 'getaddressinfo' response
This commit is contained in:
@@ -3540,6 +3540,7 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
|
||||
" \"ismine\" : true|false, (boolean) If the address is yours or not\n"
|
||||
" \"iswatchonly\" : true|false, (boolean) If the address is watchonly\n"
|
||||
" \"isscript\" : true|false, (boolean) If the key is a script\n"
|
||||
" \"ischange\" : true|false, (boolean) If the address was used for change output\n"
|
||||
" \"iswitness\" : true|false, (boolean) If the address is a witness address\n"
|
||||
" \"witness_version\" : version (numeric, optional) The version number of the witness program\n"
|
||||
" \"witness_program\" : \"hex\" (string, optional) The hex value of the witness program\n"
|
||||
@@ -3597,6 +3598,7 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
|
||||
if (pwallet->mapAddressBook.count(dest)) {
|
||||
ret.pushKV("label", pwallet->mapAddressBook[dest].name);
|
||||
}
|
||||
ret.pushKV("ischange", pwallet->IsChange(scriptPubKey));
|
||||
const CKeyMetadata* meta = nullptr;
|
||||
CKeyID key_id = GetKeyForDestination(*pwallet, dest);
|
||||
if (!key_id.IsNull()) {
|
||||
|
||||
Reference in New Issue
Block a user