psbt: Change default psbt version to 2

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

View file

@ -1332,7 +1332,7 @@ struct PartiallySignedTransaction
CMutableTransaction GetUnsignedTx() const;
uint256 GetUniqueID() const;
PartiallySignedTransaction() = default;
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

@ -489,6 +489,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)