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