@@ -7320,16 +7320,14 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7320
7320
7321
7321
fn claim_funds_internal(&self, source: HTLCSource, payment_preimage: PaymentPreimage,
7322
7322
forwarded_htlc_value_msat: Option<u64>, skimmed_fee_msat: Option<u64>, from_onchain: bool,
7323
- startup_replay: bool, next_channel_counterparty_node_id: Option< PublicKey> ,
7323
+ startup_replay: bool, next_channel_counterparty_node_id: PublicKey,
7324
7324
next_channel_outpoint: OutPoint, next_channel_id: ChannelId, next_user_channel_id: Option<u128>,
7325
7325
) {
7326
7326
match source {
7327
7327
HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } => {
7328
7328
debug_assert!(self.background_events_processed_since_startup.load(Ordering::Acquire),
7329
7329
"We don't support claim_htlc claims during startup - monitors may not be available yet");
7330
- if let Some(pubkey) = next_channel_counterparty_node_id {
7331
- debug_assert_eq!(pubkey, path.hops[0].pubkey);
7332
- }
7330
+ debug_assert_eq!(next_channel_counterparty_node_id, path.hops[0].pubkey);
7333
7331
let ev_completion_action = EventCompletionAction::ReleaseRAAChannelMonitorUpdate {
7334
7332
channel_funding_outpoint: next_channel_outpoint, channel_id: next_channel_id,
7335
7333
counterparty_node_id: path.hops[0].pubkey,
@@ -7345,22 +7343,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7345
7343
let completed_blocker = RAAMonitorUpdateBlockingAction::from_prev_hop_data(&hop_data);
7346
7344
self.claim_funds_from_hop(hop_data, payment_preimage, None,
7347
7345
|htlc_claim_value_msat, definitely_duplicate| {
7348
- let chan_to_release =
7349
- if let Some(node_id) = next_channel_counterparty_node_id {
7350
- Some(EventUnblockedChannel {
7351
- counterparty_node_id: node_id,
7352
- funding_txo: next_channel_outpoint,
7353
- channel_id: next_channel_id,
7354
- blocking_action: completed_blocker
7355
- })
7356
- } else {
7357
- // We can only get `None` here if we are processing a
7358
- // `ChannelMonitor`-originated event, in which case we
7359
- // don't care about ensuring we wake the downstream
7360
- // channel's monitor updating - the channel is already
7361
- // closed.
7362
- None
7363
- };
7346
+ let chan_to_release = Some(EventUnblockedChannel {
7347
+ counterparty_node_id: next_channel_counterparty_node_id,
7348
+ funding_txo: next_channel_outpoint,
7349
+ channel_id: next_channel_id,
7350
+ blocking_action: completed_blocker
7351
+ });
7364
7352
7365
7353
if definitely_duplicate && startup_replay {
7366
7354
// On startup we may get redundant claims which are related to
@@ -7392,7 +7380,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7392
7380
prev_user_channel_id,
7393
7381
next_user_channel_id,
7394
7382
prev_node_id,
7395
- next_node_id: next_channel_counterparty_node_id,
7383
+ next_node_id: Some( next_channel_counterparty_node_id) ,
7396
7384
total_fee_earned_msat,
7397
7385
skimmed_fee_msat,
7398
7386
claim_from_onchain_tx: from_onchain,
@@ -8801,7 +8789,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8801
8789
}
8802
8790
};
8803
8791
self.claim_funds_internal(htlc_source, msg.payment_preimage.clone(),
8804
- Some(forwarded_htlc_value), skimmed_fee_msat, false, false, Some( *counterparty_node_id) ,
8792
+ Some(forwarded_htlc_value), skimmed_fee_msat, false, false, *counterparty_node_id,
8805
8793
funding_txo, msg.channel_id, Some(next_user_channel_id),
8806
8794
);
8807
8795
@@ -9393,9 +9381,11 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9393
9381
let logger = WithContext::from(&self.logger, Some(counterparty_node_id), Some(channel_id), Some(htlc_update.payment_hash));
9394
9382
if let Some(preimage) = htlc_update.payment_preimage {
9395
9383
log_trace!(logger, "Claiming HTLC with preimage {} from our monitor", preimage);
9396
- self.claim_funds_internal(htlc_update.source, preimage,
9384
+ self.claim_funds_internal(
9385
+ htlc_update.source, preimage,
9397
9386
htlc_update.htlc_value_satoshis.map(|v| v * 1000), None, true,
9398
- false, Some(counterparty_node_id), funding_outpoint, channel_id, None);
9387
+ false, counterparty_node_id, funding_outpoint, channel_id, None,
9388
+ );
9399
9389
} else {
9400
9390
log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
9401
9391
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
@@ -14270,7 +14260,7 @@ where
14270
14260
}
14271
14261
14272
14262
Some((htlc_source, payment_preimage, htlc.amount_msat,
14273
- is_channel_closed, Some( monitor.get_counterparty_node_id() ),
14263
+ is_channel_closed, monitor.get_counterparty_node_id(),
14274
14264
monitor.get_funding_txo(), monitor.channel_id()))
14275
14265
} else { None }
14276
14266
} else {
0 commit comments