Skip to content

Commit 584168c

Browse files
committed
Merge #16326: [RPC] add new utxoupdatepsbt arguments to the CRPCCommand and CPRCCvertParam tables
91cc18f [docs] Add release notes for PR 15427 (John Newbery) 3b11420 [RPC] add new utxoupdatepsbt arguments to the CRPCCommand and CPRCConvertParam tables (John Newbery) Pull request description: The new `descriptors` argument was not added to the CRPCCommand and CPRCCvertParam tables, meaning that it couldn't be used with bitcoin-cli or named arguments. Before this PR: ``` > bitcoin-cli utxoupdatepsbt 'cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' "[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]" error code: -3 error message: Expected type array, got string > bitcoin-cli --named utxoupdatepsbt psbt='cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' descriptors="[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]" error code: -8 error message: Unknown named parameter descriptors ``` After this PR: ``` bitcoin-cli utxoupdatepsbt 'cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' "[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]" cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA== bitcoin-cli --named utxoupdatepsbt psbt='cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' descriptors="[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]" cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA== ``` ACKs for top commit: promag: ACK 91cc18f. fanquake: re-ACK 91cc18f Tree-SHA512: 279b2339a5cac17e363002e4ab743e251d6757c904c89f1970575bdce18d4f63d5e13507e171bf2bdc1bf6dd457db345a4b11b15d4ff71b96c2fedc4ffe52b23
2 parents 8c69fae + 91cc18f commit 584168c

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

doc/release-notes-15427.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Updated RPCs
2+
------------
3+
4+
The `utxoupdatepsbt` RPC method has been updated to take a `descriptors`
5+
argument. When provided, input and output scripts and keys will be filled in
6+
when known, and P2SH-witness inputs will be filled in from the UTXO set when a
7+
descriptor is provided that shows they're spending segwit outputs.
8+
9+
See the RPC help text for full details.

src/rpc/client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class CRPCConvertParam
2828
static const CRPCConvertParam vRPCConvertParams[] =
2929
{
3030
{ "setmocktime", 0, "timestamp" },
31+
{ "utxoupdatepsbt", 1, "descriptors" },
3132
{ "generatetoaddress", 0, "nblocks" },
3233
{ "generatetoaddress", 2, "maxtries" },
3334
{ "getnetworkhashps", 0, "nblocks" },

src/rpc/rawtransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ static const CRPCCommand commands[] =
17761776
{ "rawtransactions", "finalizepsbt", &finalizepsbt, {"psbt", "extract"} },
17771777
{ "rawtransactions", "createpsbt", &createpsbt, {"inputs","outputs","locktime","replaceable"} },
17781778
{ "rawtransactions", "converttopsbt", &converttopsbt, {"hexstring","permitsigdata","iswitness"} },
1779-
{ "rawtransactions", "utxoupdatepsbt", &utxoupdatepsbt, {"psbt"} },
1779+
{ "rawtransactions", "utxoupdatepsbt", &utxoupdatepsbt, {"psbt", "descriptors"} },
17801780
{ "rawtransactions", "joinpsbts", &joinpsbts, {"txs"} },
17811781
{ "rawtransactions", "analyzepsbt", &analyzepsbt, {"psbt"} },
17821782

test/functional/rpc_psbt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def test_psbt_input_keys(psbt_input, keys):
346346

347347
# Try again, now while providing descriptors, making P2SH-segwit work, and causing bip32_derivs and redeem_script to be filled in
348348
descs = [self.nodes[1].getaddressinfo(addr)['desc'] for addr in [addr1,addr2,addr3]]
349-
updated = self.nodes[1].utxoupdatepsbt(psbt, descs)
349+
updated = self.nodes[1].utxoupdatepsbt(psbt=psbt, descriptors=descs)
350350
decoded = self.nodes[1].decodepsbt(updated)
351351
test_psbt_input_keys(decoded['inputs'][0], ['witness_utxo', 'bip32_derivs'])
352352
test_psbt_input_keys(decoded['inputs'][1], [])

0 commit comments

Comments
 (0)