mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-07 13:18:43 +02:00
Merge #18032: rpc: Output a descriptor in createmultisig and addmultisigaddress
19a354b11fOutput a descriptor in createmultisig and addmultisigaddress (Andrew Chow) Pull request description: Give a descriptor from `createmultisig` and `addmultisigaddress`. Extracted from #16528 with `addmultisgaddress` and tests added. ACKs for top commit: Sjors: tACK19a354b11fMarcoFalke: ACK19a354b11fpromag: Code review ACK19a354b11f. meshcollider: utACK19a354b11fTree-SHA512: e813125fbbc358ea8d45b1748de16a29a94efd83175b748fb8fa3b0bfc8e783ed36b6c554d84f5d4ead1ba252a83a3e937b6c3f75da7b8d3b4e55f94d6013771
This commit is contained in:
@@ -83,6 +83,7 @@ static UniValue createmultisig(const JSONRPCRequest& request)
|
||||
"{\n"
|
||||
" \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n"
|
||||
" \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n"
|
||||
" \"descriptor\":\"descriptor\" (string) The descriptor for this multisig\n"
|
||||
"}\n"
|
||||
},
|
||||
RPCExamples{
|
||||
@@ -119,9 +120,13 @@ static UniValue createmultisig(const JSONRPCRequest& request)
|
||||
CScript inner;
|
||||
const CTxDestination dest = AddAndGetMultisigDestination(required, pubkeys, output_type, keystore, inner);
|
||||
|
||||
// Make the descriptor
|
||||
std::unique_ptr<Descriptor> descriptor = InferDescriptor(GetScriptForDestination(dest), keystore);
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
result.pushKV("address", EncodeDestination(dest));
|
||||
result.pushKV("redeemScript", HexStr(inner.begin(), inner.end()));
|
||||
result.pushKV("descriptor", descriptor->ToString());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user