@@ -4573,17 +4573,20 @@ impl<Signer: Sign> Channel<Signer> {
4573
4573
}
4574
4574
4575
4575
/// Determines whether the parameters of an incoming HTLC to be forwarded satisfy the channel's
4576
- /// [`ChannelConfig`]. This first looks at the channel's previous [`ChannelConfig`], if any, and
4577
- /// if unsuccessful, falls back to the current one.
4576
+ /// [`ChannelConfig`]. This first looks at the channel's current [`ChannelConfig`], and if
4577
+ /// unsuccessful, falls back to the previous one if one exists .
4578
4578
pub fn htlc_satisfies_config (
4579
4579
& self , htlc : & msgs:: UpdateAddHTLC , amt_to_forward : u64 , outgoing_cltv_value : u32 ,
4580
4580
) -> Result < ( ) , ( & ' static str , u16 ) > {
4581
+ let res = self . internal_htlc_satisfies_config ( & htlc, amt_to_forward, outgoing_cltv_value, & self . config ( ) ) ;
4582
+ if res. is_ok ( ) {
4583
+ return res;
4584
+ }
4581
4585
if let Some ( prev_config) = self . prev_config ( ) {
4582
- if self . internal_htlc_satisfies_config ( htlc, amt_to_forward, outgoing_cltv_value, & prev_config) . is_ok ( ) {
4583
- return Ok ( ( ) ) ;
4584
- }
4586
+ self . internal_htlc_satisfies_config ( htlc, amt_to_forward, outgoing_cltv_value, & prev_config)
4587
+ } else {
4588
+ res
4585
4589
}
4586
- self . internal_htlc_satisfies_config ( & htlc, amt_to_forward, outgoing_cltv_value, & self . config ( ) )
4587
4590
}
4588
4591
4589
4592
pub fn get_feerate ( & self ) -> u32 {
0 commit comments