mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 16:24:48 +02:00
rpc: output parent wallet descriptors for coins in listunspent
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user