diff --git a/src/descriptor/mod.rs b/src/descriptor/mod.rs index 08bb1e418..3dde5ebbf 100644 --- a/src/descriptor/mod.rs +++ b/src/descriptor/mod.rs @@ -347,12 +347,12 @@ impl Descriptor { )] pub fn max_satisfaction_weight(&self) -> Result { let weight = match *self { - Descriptor::Bare(ref bare) => bare.max_satisfaction_weight()?, - Descriptor::Pkh(ref pkh) => pkh.max_satisfaction_weight(), - Descriptor::Wpkh(ref wpkh) => wpkh.max_satisfaction_weight(), - Descriptor::Wsh(ref wsh) => wsh.max_satisfaction_weight()?, - Descriptor::Sh(ref sh) => sh.max_satisfaction_weight()?, - Descriptor::Tr(ref tr) => tr.max_satisfaction_weight()?, + Descriptor::Bare(ref bare) => bare.max_weight_to_satisfy()?, + Descriptor::Pkh(ref pkh) => pkh.max_weight_to_satisfy(), + Descriptor::Wpkh(ref wpkh) => wpkh.max_weight_to_satisfy(), + Descriptor::Wsh(ref wsh) => wsh.max_weight_to_satisfy()?, + Descriptor::Sh(ref sh) => sh.max_weight_to_satisfy()?, + Descriptor::Tr(ref tr) => tr.max_weight_to_satisfy()?, }; Ok(weight) } diff --git a/src/descriptor/sh.rs b/src/descriptor/sh.rs index 133fd313d..9f99f3b53 100644 --- a/src/descriptor/sh.rs +++ b/src/descriptor/sh.rs @@ -239,7 +239,7 @@ impl Sh { pub fn max_satisfaction_weight(&self) -> Result { Ok(match self.inner { // add weighted script sig, len byte stays the same - ShInner::Wsh(ref wsh) => 4 * 35 + wsh.max_satisfaction_weight()?, + ShInner::Wsh(ref wsh) => 4 * 35 + wsh.max_weight_to_satisfy()?, ShInner::SortedMulti(ref smv) => { let ss = smv.script_size(); let ps = push_opcode_size(ss); @@ -247,7 +247,7 @@ impl Sh { 4 * (varint_len(scriptsig_len) + scriptsig_len) } // add weighted script sig, len byte stays the same - ShInner::Wpkh(ref wpkh) => 4 * 23 + wpkh.max_satisfaction_weight(), + ShInner::Wpkh(ref wpkh) => 4 * 23 + wpkh.max_weight_to_satisfy(), ShInner::Ms(ref ms) => { let ss = ms.script_size(); let ps = push_opcode_size(ss);