@@ -7307,16 +7307,14 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7307
7307
7308
7308
fn claim_funds_internal(&self, source: HTLCSource, payment_preimage: PaymentPreimage,
7309
7309
forwarded_htlc_value_msat: Option<u64>, skimmed_fee_msat: Option<u64>, from_onchain: bool,
7310
- startup_replay: bool, next_channel_counterparty_node_id: Option< PublicKey> ,
7310
+ startup_replay: bool, next_channel_counterparty_node_id: PublicKey,
7311
7311
next_channel_outpoint: OutPoint, next_channel_id: ChannelId, next_user_channel_id: Option<u128>,
7312
7312
) {
7313
7313
match source {
7314
7314
HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } => {
7315
7315
debug_assert!(self.background_events_processed_since_startup.load(Ordering::Acquire),
7316
7316
"We don't support claim_htlc claims during startup - monitors may not be available yet");
7317
- if let Some(pubkey) = next_channel_counterparty_node_id {
7318
- debug_assert_eq!(pubkey, path.hops[0].pubkey);
7319
- }
7317
+ debug_assert_eq!(next_channel_counterparty_node_id, path.hops[0].pubkey);
7320
7318
let ev_completion_action = EventCompletionAction::ReleaseRAAChannelMonitorUpdate {
7321
7319
channel_funding_outpoint: next_channel_outpoint, channel_id: next_channel_id,
7322
7320
counterparty_node_id: path.hops[0].pubkey,
@@ -7332,22 +7330,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7332
7330
let completed_blocker = RAAMonitorUpdateBlockingAction::from_prev_hop_data(&hop_data);
7333
7331
self.claim_funds_from_hop(hop_data, payment_preimage, None,
7334
7332
|htlc_claim_value_msat, definitely_duplicate| {
7335
- let chan_to_release =
7336
- if let Some(node_id) = next_channel_counterparty_node_id {
7337
- Some(EventUnblockedChannel {
7338
- counterparty_node_id: node_id,
7339
- funding_txo: next_channel_outpoint,
7340
- channel_id: next_channel_id,
7341
- blocking_action: completed_blocker
7342
- })
7343
- } else {
7344
- // We can only get `None` here if we are processing a
7345
- // `ChannelMonitor`-originated event, in which case we
7346
- // don't care about ensuring we wake the downstream
7347
- // channel's monitor updating - the channel is already
7348
- // closed.
7349
- None
7350
- };
7333
+ let chan_to_release = Some(EventUnblockedChannel {
7334
+ counterparty_node_id: next_channel_counterparty_node_id,
7335
+ funding_txo: next_channel_outpoint,
7336
+ channel_id: next_channel_id,
7337
+ blocking_action: completed_blocker
7338
+ });
7351
7339
7352
7340
if definitely_duplicate && startup_replay {
7353
7341
// On startup we may get redundant claims which are related to
@@ -7379,7 +7367,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7379
7367
prev_user_channel_id,
7380
7368
next_user_channel_id,
7381
7369
prev_node_id,
7382
- next_node_id: next_channel_counterparty_node_id,
7370
+ next_node_id: Some( next_channel_counterparty_node_id) ,
7383
7371
total_fee_earned_msat,
7384
7372
skimmed_fee_msat,
7385
7373
claim_from_onchain_tx: from_onchain,
@@ -8788,7 +8776,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8788
8776
}
8789
8777
};
8790
8778
self.claim_funds_internal(htlc_source, msg.payment_preimage.clone(),
8791
- Some(forwarded_htlc_value), skimmed_fee_msat, false, false, Some( *counterparty_node_id) ,
8779
+ Some(forwarded_htlc_value), skimmed_fee_msat, false, false, *counterparty_node_id,
8792
8780
funding_txo, msg.channel_id, Some(next_user_channel_id),
8793
8781
);
8794
8782
@@ -9380,9 +9368,11 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9380
9368
let logger = WithContext::from(&self.logger, Some(counterparty_node_id), Some(channel_id), Some(htlc_update.payment_hash));
9381
9369
if let Some(preimage) = htlc_update.payment_preimage {
9382
9370
log_trace!(logger, "Claiming HTLC with preimage {} from our monitor", preimage);
9383
- self.claim_funds_internal(htlc_update.source, preimage,
9371
+ self.claim_funds_internal(
9372
+ htlc_update.source, preimage,
9384
9373
htlc_update.htlc_value_satoshis.map(|v| v * 1000), None, true,
9385
- false, Some(counterparty_node_id), funding_outpoint, channel_id, None);
9374
+ false, counterparty_node_id, funding_outpoint, channel_id, None,
9375
+ );
9386
9376
} else {
9387
9377
log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
9388
9378
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
@@ -14257,7 +14247,7 @@ where
14257
14247
}
14258
14248
14259
14249
Some((htlc_source, payment_preimage, htlc.amount_msat,
14260
- is_channel_closed, Some( monitor.get_counterparty_node_id() ),
14250
+ is_channel_closed, monitor.get_counterparty_node_id(),
14261
14251
monitor.get_funding_txo(), monitor.channel_id()))
14262
14252
} else { None }
14263
14253
} else {
0 commit comments