@@ -6159,21 +6159,13 @@ where
6159
6159
}
6160
6160
if valid_mpp {
6161
6161
for htlc in sources.drain(..) {
6162
- let prev_hop_chan_id = htlc.prev_hop.channel_id;
6163
- if let Err((pk, err)) = self.claim_funds_from_hop(
6162
+ self.claim_funds_from_hop(
6164
6163
htlc.prev_hop, payment_preimage,
6165
6164
|_, definitely_duplicate| {
6166
6165
debug_assert!(!definitely_duplicate, "We shouldn't claim duplicatively from a payment");
6167
6166
Some(MonitorUpdateCompletionAction::PaymentClaimed { payment_hash })
6168
6167
}
6169
- ) {
6170
- if let msgs::ErrorAction::IgnoreError = err.err.action {
6171
- // We got a temporary failure updating monitor, but will claim the
6172
- // HTLC when the monitor updating is restored (or on chain).
6173
- let logger = WithContext::from(&self.logger, None, Some(prev_hop_chan_id), Some(payment_hash));
6174
- log_error!(logger, "Temporary failure claiming HTLC, treating as success: {}", err.err.err);
6175
- } else { errs.push((pk, err)); }
6176
- }
6168
+ );
6177
6169
}
6178
6170
}
6179
6171
if !valid_mpp {
@@ -6195,9 +6187,10 @@ where
6195
6187
}
6196
6188
}
6197
6189
6198
- fn claim_funds_from_hop<ComplFunc: FnOnce(Option<u64>, bool) -> Option<MonitorUpdateCompletionAction>>(&self,
6199
- prev_hop: HTLCPreviousHopData, payment_preimage: PaymentPreimage, completion_action: ComplFunc)
6200
- -> Result<(), (PublicKey, MsgHandleErrInternal)> {
6190
+ fn claim_funds_from_hop<ComplFunc: FnOnce(Option<u64>, bool) -> Option<MonitorUpdateCompletionAction>>(
6191
+ &self, prev_hop: HTLCPreviousHopData, payment_preimage: PaymentPreimage,
6192
+ completion_action: ComplFunc,
6193
+ ) {
6201
6194
//TODO: Delay the claimed_funds relaying just like we do outbound relay!
6202
6195
6203
6196
// If we haven't yet run background events assume we're still deserializing and shouldn't
@@ -6259,7 +6252,7 @@ where
6259
6252
let action = if let Some(action) = completion_action(None, true) {
6260
6253
action
6261
6254
} else {
6262
- return Ok(()) ;
6255
+ return;
6263
6256
};
6264
6257
mem::drop(peer_state_lock);
6265
6258
@@ -6275,7 +6268,7 @@ where
6275
6268
} else {
6276
6269
debug_assert!(false,
6277
6270
"Duplicate claims should always free another channel immediately");
6278
- return Ok(()) ;
6271
+ return;
6279
6272
};
6280
6273
if let Some(peer_state_mtx) = per_peer_state.get(&node_id) {
6281
6274
let mut peer_state = peer_state_mtx.lock().unwrap();
@@ -6300,7 +6293,7 @@ where
6300
6293
}
6301
6294
}
6302
6295
}
6303
- return Ok(()) ;
6296
+ return;
6304
6297
}
6305
6298
}
6306
6299
}
@@ -6348,7 +6341,6 @@ where
6348
6341
// generally always allowed to be duplicative (and it's specifically noted in
6349
6342
// `PaymentForwarded`).
6350
6343
self.handle_monitor_update_completion_actions(completion_action(None, false));
6351
- Ok(())
6352
6344
}
6353
6345
6354
6346
fn finalize_claims(&self, sources: Vec<HTLCSource>) {
@@ -6381,7 +6373,7 @@ where
6381
6373
let completed_blocker = RAAMonitorUpdateBlockingAction::from_prev_hop_data(&hop_data);
6382
6374
#[cfg(debug_assertions)]
6383
6375
let claiming_chan_funding_outpoint = hop_data.outpoint;
6384
- let res = self.claim_funds_from_hop(hop_data, payment_preimage,
6376
+ self.claim_funds_from_hop(hop_data, payment_preimage,
6385
6377
|htlc_claim_value_msat, definitely_duplicate| {
6386
6378
let chan_to_release =
6387
6379
if let Some(node_id) = next_channel_counterparty_node_id {
@@ -6475,10 +6467,6 @@ where
6475
6467
})
6476
6468
}
6477
6469
});
6478
- if let Err((pk, err)) = res {
6479
- let result: Result<(), _> = Err(err);
6480
- let _ = handle_error!(self, result, pk);
6481
- }
6482
6470
},
6483
6471
}
6484
6472
}
0 commit comments