psbt: Change default psbt version to 2

This commit is contained in:
Ava Chow
2024-07-22 17:14:53 -04:00
parent bcc1dca77b
commit e0e4dbdeb5
2 changed files with 4 additions and 1 deletions

View File

@@ -1260,7 +1260,7 @@ public:
std::optional<uint32_t> ComputeTimeLock() const;
std::optional<CMutableTransaction> GetUnsignedTx() const;
std::optional<Txid> GetUniqueID() const;
explicit PartiallySignedTransaction(const CMutableTransaction& tx, uint32_t version = 0);
explicit PartiallySignedTransaction(const CMutableTransaction& tx, uint32_t version = 2);
template <typename Stream>
inline void Serialize(Stream& s) const {

View File

@@ -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)