From e0e4dbdeb5c863afe0453f12062ac93cf1cb25cd Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Mon, 22 Jul 2024 17:14:53 -0400 Subject: [PATCH] psbt: Change default psbt version to 2 --- src/psbt.h | 2 +- test/functional/rpc_psbt.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/psbt.h b/src/psbt.h index 9e514f2eaa8..bca999534c7 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -1260,7 +1260,7 @@ public: std::optional ComputeTimeLock() const; std::optional GetUnsignedTx() const; std::optional GetUniqueID() const; - explicit PartiallySignedTransaction(const CMutableTransaction& tx, uint32_t version = 0); + explicit PartiallySignedTransaction(const CMutableTransaction& tx, uint32_t version = 2); template inline void Serialize(Stream& s) const { diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 3c3e72887bd..9a75a35d25d 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -761,6 +761,9 @@ class PSBTTest(BitcoinTestFramework): # Create a psbt spending outputs from nodes 1 and 2 psbt_orig = self.nodes[0].createpsbt([utxo1, utxo2], {self.nodes[0].getnewaddress():25.999}) + # Check that the default psbt version is 2 + assert_equal(self.nodes[0].decodepsbt(psbt_orig)["psbt_version"], 2) + # Update psbts, should only have data for one input and not the other psbt1 = self.nodes[1].walletprocesspsbt(psbt_orig, False, "ALL")['psbt'] psbt1_decoded = self.nodes[0].decodepsbt(psbt1)