File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -695,17 +695,21 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
695
695
/// Returns an error if there is at least one satisfaction that contains
696
696
/// a combination of heightlock and timelock.
697
697
pub fn check_timelocks ( & self ) -> Result < ( ) , PolicyError > {
698
- let timelocks = self . check_timelocks_helper ( ) ;
699
- if timelocks . contains_combination {
698
+ let aggregated_timelock_info = self . timelock_info ( ) ;
699
+ if aggregated_timelock_info . contains_combination {
700
700
Err ( PolicyError :: HeightTimelockCombination )
701
701
} else {
702
702
Ok ( ( ) )
703
703
}
704
704
}
705
705
706
- // Checks whether the given concrete policy contains a combination of
707
- // timelocks and heightlocks
708
- fn check_timelocks_helper ( & self ) -> TimelockInfo {
706
+ /// Processes `Policy` using `post_order_iter`, creates a `TimelockInfo` for each `Nullary` node
707
+ /// and combines them together for `Nary` nodes.
708
+ ///
709
+ /// # Returns
710
+ ///
711
+ /// A single `TimelockInfo` that is the combination of all others after processing each node.
712
+ fn timelock_info ( & self ) -> TimelockInfo {
709
713
use Policy :: * ;
710
714
711
715
let mut infos = vec ! [ ] ;
You can’t perform that action at this time.
0 commit comments