@@ -225,26 +225,11 @@ impl ChannelState {
225
225
Ok ( ( ) )
226
226
}
227
227
228
- /// Removes the HTLC from our set of outgoing in-flight HTLCs, failing if the payment hash is not found. If the
229
- /// HTLC failed, the balance is returned to our local liquidity. Note that this function is not responsible for
230
- /// reflecting that the balance has moved to the other side of the channel in the success-case, calling code is
231
- /// responsible for that.
232
- fn remove_outgoing_htlc (
233
- & mut self ,
234
- hash : & PaymentHash ,
235
- success : bool ,
236
- ) -> Result < Htlc , ForwardingError > {
237
- match self . in_flight . remove ( hash) {
238
- Some ( v) => {
239
- // If the HTLC failed, pending balance returns to local balance.
240
- if !success {
241
- self . local_balance_msat += v. amount_msat ;
242
- }
243
-
244
- Ok ( v)
245
- } ,
246
- None => Err ( ForwardingError :: PaymentHashNotFound ( * hash) ) ,
247
- }
228
+ /// Removes the HTLC from our set of outgoing in-flight HTLCs, failing if the payment hash is not found.
229
+ fn remove_outgoing_htlc ( & mut self , hash : & PaymentHash ) -> Result < Htlc , ForwardingError > {
230
+ self . in_flight
231
+ . remove ( hash)
232
+ . ok_or ( ForwardingError :: PaymentHashNotFound ( * hash) )
248
233
}
249
234
}
250
235
@@ -349,7 +334,7 @@ impl SimulatedChannel {
349
334
) -> Result < ( ) , ForwardingError > {
350
335
let htlc = self
351
336
. get_node_mut ( sending_node) ?
352
- . remove_outgoing_htlc ( hash, success ) ?;
337
+ . remove_outgoing_htlc ( hash) ?;
353
338
self . settle_htlc ( sending_node, htlc. amount_msat , success) ?;
354
339
self . sanity_check ( )
355
340
}
0 commit comments