We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86fdda9 commit 543b263Copy full SHA for 543b263
src/wallet/mod.rs
@@ -1551,12 +1551,18 @@ where
1551
Ok(self
1552
.iter_unspent()?
1553
.map(|utxo| {
1554
- let keychain = utxo.keychain;
+ let desc = self.get_descriptor_for_keychain(utxo.keychain);
1555
+
1556
+ // WORKAROUND: There is a bug in miniscript where they fail to take into
1557
+ // consideration an `OP_PUSH..` (4 weight units) for `pkh` script types.
1558
+ let workaround_weight = match desc.desc_type() {
1559
+ DescriptorType::Pkh => 4_usize,
1560
+ _ => 0_usize,
1561
+ };
1562
1563
(
1564
utxo,
- self.get_descriptor_for_keychain(keychain)
- .max_satisfaction_weight()
- .unwrap(),
1565
+ desc.max_satisfaction_weight().unwrap() + workaround_weight,
1566
)
1567
})
1568
.collect())
0 commit comments