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 @@ -685,17 +685,21 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
685
685
/// Returns an error if there is at least one satisfaction that contains
686
686
/// a combination of heightlock and timelock.
687
687
pub fn check_timelocks ( & self ) -> Result < ( ) , PolicyError > {
688
- let timelocks = self . check_timelocks_helper ( ) ;
689
- if timelocks . contains_combination {
688
+ let aggregated_timelock_info = self . timelock_info ( ) ;
689
+ if aggregated_timelock_info . contains_combination {
690
690
Err ( PolicyError :: HeightTimelockCombination )
691
691
} else {
692
692
Ok ( ( ) )
693
693
}
694
694
}
695
695
696
- // Checks whether the given concrete policy contains a combination of
697
- // timelocks and heightlocks
698
- fn check_timelocks_helper ( & self ) -> TimelockInfo {
696
+ /// Processes `Policy` using `post_order_iter`, creates a `TimelockInfo` for each `Nullary` node
697
+ /// and combines them together for `Nary` nodes.
698
+ ///
699
+ /// # Returns
700
+ ///
701
+ /// A single `TimelockInfo` that is the combination of all others after processing each node.
702
+ fn timelock_info ( & self ) -> TimelockInfo {
699
703
use Policy :: * ;
700
704
701
705
let mut infos = vec ! [ ] ;
You can’t perform that action at this time.
0 commit comments