@@ -7312,16 +7312,14 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7312
7312
7313
7313
fn claim_funds_internal(&self, source: HTLCSource, payment_preimage: PaymentPreimage,
7314
7314
forwarded_htlc_value_msat: Option<u64>, skimmed_fee_msat: Option<u64>, from_onchain: bool,
7315
- startup_replay: bool, next_channel_counterparty_node_id: Option< PublicKey> ,
7315
+ startup_replay: bool, next_channel_counterparty_node_id: PublicKey,
7316
7316
next_channel_outpoint: OutPoint, next_channel_id: ChannelId, next_user_channel_id: Option<u128>,
7317
7317
) {
7318
7318
match source {
7319
7319
HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } => {
7320
7320
debug_assert!(self.background_events_processed_since_startup.load(Ordering::Acquire),
7321
7321
"We don't support claim_htlc claims during startup - monitors may not be available yet");
7322
- if let Some(pubkey) = next_channel_counterparty_node_id {
7323
- debug_assert_eq!(pubkey, path.hops[0].pubkey);
7324
- }
7322
+ debug_assert_eq!(next_channel_counterparty_node_id, path.hops[0].pubkey);
7325
7323
let ev_completion_action = EventCompletionAction::ReleaseRAAChannelMonitorUpdate {
7326
7324
channel_funding_outpoint: next_channel_outpoint, channel_id: next_channel_id,
7327
7325
counterparty_node_id: path.hops[0].pubkey,
@@ -7337,22 +7335,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7337
7335
let completed_blocker = RAAMonitorUpdateBlockingAction::from_prev_hop_data(&hop_data);
7338
7336
self.claim_funds_from_hop(hop_data, payment_preimage, None,
7339
7337
|htlc_claim_value_msat, definitely_duplicate| {
7340
- let chan_to_release =
7341
- if let Some(node_id) = next_channel_counterparty_node_id {
7342
- Some(EventUnblockedChannel {
7343
- counterparty_node_id: node_id,
7344
- funding_txo: next_channel_outpoint,
7345
- channel_id: next_channel_id,
7346
- blocking_action: completed_blocker
7347
- })
7348
- } else {
7349
- // We can only get `None` here if we are processing a
7350
- // `ChannelMonitor`-originated event, in which case we
7351
- // don't care about ensuring we wake the downstream
7352
- // channel's monitor updating - the channel is already
7353
- // closed.
7354
- None
7355
- };
7338
+ let chan_to_release = Some(EventUnblockedChannel {
7339
+ counterparty_node_id: next_channel_counterparty_node_id,
7340
+ funding_txo: next_channel_outpoint,
7341
+ channel_id: next_channel_id,
7342
+ blocking_action: completed_blocker
7343
+ });
7356
7344
7357
7345
if definitely_duplicate && startup_replay {
7358
7346
// On startup we may get redundant claims which are related to
@@ -7384,7 +7372,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7384
7372
prev_user_channel_id,
7385
7373
next_user_channel_id,
7386
7374
prev_node_id,
7387
- next_node_id: next_channel_counterparty_node_id,
7375
+ next_node_id: Some( next_channel_counterparty_node_id) ,
7388
7376
total_fee_earned_msat,
7389
7377
skimmed_fee_msat,
7390
7378
claim_from_onchain_tx: from_onchain,
@@ -8793,7 +8781,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8793
8781
}
8794
8782
};
8795
8783
self.claim_funds_internal(htlc_source, msg.payment_preimage.clone(),
8796
- Some(forwarded_htlc_value), skimmed_fee_msat, false, false, Some( *counterparty_node_id) ,
8784
+ Some(forwarded_htlc_value), skimmed_fee_msat, false, false, *counterparty_node_id,
8797
8785
funding_txo, msg.channel_id, Some(next_user_channel_id),
8798
8786
);
8799
8787
@@ -9385,9 +9373,11 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9385
9373
let logger = WithContext::from(&self.logger, Some(counterparty_node_id), Some(channel_id), Some(htlc_update.payment_hash));
9386
9374
if let Some(preimage) = htlc_update.payment_preimage {
9387
9375
log_trace!(logger, "Claiming HTLC with preimage {} from our monitor", preimage);
9388
- self.claim_funds_internal(htlc_update.source, preimage,
9376
+ self.claim_funds_internal(
9377
+ htlc_update.source, preimage,
9389
9378
htlc_update.htlc_value_satoshis.map(|v| v * 1000), None, true,
9390
- false, Some(counterparty_node_id), funding_outpoint, channel_id, None);
9379
+ false, counterparty_node_id, funding_outpoint, channel_id, None,
9380
+ );
9391
9381
} else {
9392
9382
log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
9393
9383
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
@@ -14262,7 +14252,7 @@ where
14262
14252
}
14263
14253
14264
14254
Some((htlc_source, payment_preimage, htlc.amount_msat,
14265
- is_channel_closed, Some( monitor.get_counterparty_node_id() ),
14255
+ is_channel_closed, monitor.get_counterparty_node_id(),
14266
14256
monitor.get_funding_txo(), monitor.channel_id()))
14267
14257
} else { None }
14268
14258
} else {
0 commit comments