diff options
author | Antoine Poinsot <darosior@protonmail.com> | 2022-07-05 14:42:06 +0200 |
---|---|---|
committer | Antoine Poinsot <darosior@protonmail.com> | 2022-07-19 12:46:15 +0200 |
commit | 55f98d087efd2609d808c082d5770306cc489409 (patch) | |
tree | 0bc7efce798c58b26e53327dd4b4017f35de8a04 /src/wallet/rpc | |
parent | b724476158a7dfeef9edfda3f519dfd6f93202a8 (diff) | |
download | bitcoin-55f98d087efd2609d808c082d5770306cc489409.tar.xz |
rpc: output parent wallet descriptors for coins in listunspent
Diffstat (limited to 'src/wallet/rpc')
-rw-r--r-- | src/wallet/rpc/coins.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp index a9fff95882..0dd514175d 100644 --- a/src/wallet/rpc/coins.cpp +++ b/src/wallet/rpc/coins.cpp @@ -543,6 +543,9 @@ RPCHelpMan listunspent() {RPCResult::Type::BOOL, "solvable", "Whether we know how to spend this output, ignoring the lack of keys"}, {RPCResult::Type::BOOL, "reused", /*optional=*/true, "(only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from)"}, {RPCResult::Type::STR, "desc", /*optional=*/true, "(only when solvable) A descriptor for spending this output"}, + {RPCResult::Type::ARR, "parent_descs", /*optional=*/false, "List of parent descriptors for the scriptPubKey of this coin.", { + {RPCResult::Type::STR, "desc", "The descriptor string."}, + }}, {RPCResult::Type::BOOL, "safe", "Whether this output is considered safe to spend. Unconfirmed transactions\n" "from outside keys and unconfirmed replacement transactions are considered unsafe\n" "and are not eligible for spending by fundrawtransaction and sendtoaddress."}, @@ -722,6 +725,7 @@ RPCHelpMan listunspent() entry.pushKV("desc", descriptor->ToString()); } } + PushParentDescriptors(*pwallet, scriptPubKey, entry); if (avoid_reuse) entry.pushKV("reused", reused); entry.pushKV("safe", out.safe); results.push_back(entry); |