@@ -7335,16 +7335,14 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7335
7335
7336
7336
fn claim_funds_internal(&self, source: HTLCSource, payment_preimage: PaymentPreimage,
7337
7337
forwarded_htlc_value_msat: Option<u64>, skimmed_fee_msat: Option<u64>, from_onchain: bool,
7338
- startup_replay: bool, next_channel_counterparty_node_id: Option< PublicKey> ,
7338
+ startup_replay: bool, next_channel_counterparty_node_id: PublicKey,
7339
7339
next_channel_outpoint: OutPoint, next_channel_id: ChannelId, next_user_channel_id: Option<u128>,
7340
7340
) {
7341
7341
match source {
7342
7342
HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } => {
7343
7343
debug_assert!(self.background_events_processed_since_startup.load(Ordering::Acquire),
7344
7344
"We don't support claim_htlc claims during startup - monitors may not be available yet");
7345
- if let Some(pubkey) = next_channel_counterparty_node_id {
7346
- debug_assert_eq!(pubkey, path.hops[0].pubkey);
7347
- }
7345
+ debug_assert_eq!(next_channel_counterparty_node_id, path.hops[0].pubkey);
7348
7346
let ev_completion_action = EventCompletionAction::ReleaseRAAChannelMonitorUpdate {
7349
7347
channel_funding_outpoint: next_channel_outpoint, channel_id: next_channel_id,
7350
7348
counterparty_node_id: path.hops[0].pubkey,
@@ -7360,22 +7358,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7360
7358
let completed_blocker = RAAMonitorUpdateBlockingAction::from_prev_hop_data(&hop_data);
7361
7359
self.claim_funds_from_hop(hop_data, payment_preimage, None,
7362
7360
|htlc_claim_value_msat, definitely_duplicate| {
7363
- let chan_to_release =
7364
- if let Some(node_id) = next_channel_counterparty_node_id {
7365
- Some(EventUnblockedChannel {
7366
- counterparty_node_id: node_id,
7367
- funding_txo: next_channel_outpoint,
7368
- channel_id: next_channel_id,
7369
- blocking_action: completed_blocker
7370
- })
7371
- } else {
7372
- // We can only get `None` here if we are processing a
7373
- // `ChannelMonitor`-originated event, in which case we
7374
- // don't care about ensuring we wake the downstream
7375
- // channel's monitor updating - the channel is already
7376
- // closed.
7377
- None
7378
- };
7361
+ let chan_to_release = Some(EventUnblockedChannel {
7362
+ counterparty_node_id: next_channel_counterparty_node_id,
7363
+ funding_txo: next_channel_outpoint,
7364
+ channel_id: next_channel_id,
7365
+ blocking_action: completed_blocker
7366
+ });
7379
7367
7380
7368
if definitely_duplicate && startup_replay {
7381
7369
// On startup we may get redundant claims which are related to
@@ -7407,7 +7395,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7407
7395
prev_user_channel_id,
7408
7396
next_user_channel_id,
7409
7397
prev_node_id,
7410
- next_node_id: next_channel_counterparty_node_id,
7398
+ next_node_id: Some( next_channel_counterparty_node_id) ,
7411
7399
total_fee_earned_msat,
7412
7400
skimmed_fee_msat,
7413
7401
claim_from_onchain_tx: from_onchain,
@@ -8816,7 +8804,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8816
8804
}
8817
8805
};
8818
8806
self.claim_funds_internal(htlc_source, msg.payment_preimage.clone(),
8819
- Some(forwarded_htlc_value), skimmed_fee_msat, false, false, Some( *counterparty_node_id) ,
8807
+ Some(forwarded_htlc_value), skimmed_fee_msat, false, false, *counterparty_node_id,
8820
8808
funding_txo, msg.channel_id, Some(next_user_channel_id),
8821
8809
);
8822
8810
@@ -9408,9 +9396,11 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9408
9396
let logger = WithContext::from(&self.logger, Some(counterparty_node_id), Some(channel_id), Some(htlc_update.payment_hash));
9409
9397
if let Some(preimage) = htlc_update.payment_preimage {
9410
9398
log_trace!(logger, "Claiming HTLC with preimage {} from our monitor", preimage);
9411
- self.claim_funds_internal(htlc_update.source, preimage,
9399
+ self.claim_funds_internal(
9400
+ htlc_update.source, preimage,
9412
9401
htlc_update.htlc_value_satoshis.map(|v| v * 1000), None, true,
9413
- false, Some(counterparty_node_id), funding_outpoint, channel_id, None);
9402
+ false, counterparty_node_id, funding_outpoint, channel_id, None,
9403
+ );
9414
9404
} else {
9415
9405
log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
9416
9406
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
@@ -14285,7 +14275,7 @@ where
14285
14275
}
14286
14276
14287
14277
Some((htlc_source, payment_preimage, htlc.amount_msat,
14288
- is_channel_closed, Some( monitor.get_counterparty_node_id() ),
14278
+ is_channel_closed, monitor.get_counterparty_node_id(),
14289
14279
monitor.get_funding_txo(), monitor.channel_id()))
14290
14280
} else { None }
14291
14281
} else {
0 commit comments