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