File tree 1 file changed +18
-19
lines changed
lightning-liquidity/src/lsps2
1 file changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -1085,27 +1085,26 @@ where
1085
1085
) ,
1086
1086
} ) ?;
1087
1087
1088
- let mut payment_queue =
1089
- if let OutboundJITChannelState :: PendingChannelOpen { payment_queue , .. } =
1090
- & mut jit_channel . state
1091
- {
1092
- core :: mem :: take ( payment_queue )
1093
- } else {
1094
- return Err ( APIError :: APIMisuseError {
1095
- err : "Channel is not in the PendingChannelOpen state." . to_string ( ) ,
1096
- } ) ;
1097
- } ;
1088
+ if let OutboundJITChannelState :: PendingChannelOpen { payment_queue, .. } =
1089
+ & mut jit_channel . state
1090
+ {
1091
+ let intercepted_htlcs = payment_queue . clear ( ) ;
1092
+ for htlc in intercepted_htlcs {
1093
+ self . channel_manager . get_cm ( ) . fail_htlc_backwards_with_reason (
1094
+ & htlc . payment_hash ,
1095
+ FailureCode :: TemporaryNodeFailure ,
1096
+ ) ;
1097
+ }
1098
1098
1099
- for htlc in payment_queue. clear ( ) {
1100
- self . channel_manager . get_cm ( ) . fail_htlc_backwards_with_reason (
1101
- & htlc. payment_hash ,
1102
- FailureCode :: TemporaryNodeFailure ,
1103
- ) ;
1099
+ jit_channel. state = OutboundJITChannelState :: PendingInitialPayment {
1100
+ payment_queue : PaymentQueue :: new ( ) ,
1101
+ } ;
1102
+ Ok ( ( ) )
1103
+ } else {
1104
+ Err ( APIError :: APIMisuseError {
1105
+ err : "Channel is not in the PendingChannelOpen state." . to_string ( ) ,
1106
+ } )
1104
1107
}
1105
-
1106
- jit_channel. state = OutboundJITChannelState :: PendingInitialPayment { payment_queue } ;
1107
-
1108
- Ok ( ( ) )
1109
1108
}
1110
1109
1111
1110
/// Forward [`Event::ChannelReady`] event parameters into this function.
You can’t perform that action at this time.
0 commit comments