@@ -7412,13 +7412,11 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
7412
7412
7413
7413
fn claim_funds_internal(&self, source: HTLCSource, payment_preimage: PaymentPreimage,
7414
7414
forwarded_htlc_value_msat: Option<u64>, skimmed_fee_msat: Option<u64>, from_onchain: bool,
7415
- startup_replay: bool, next_channel_counterparty_node_id: Option<PublicKey>,
7415
+ next_channel_counterparty_node_id: Option<PublicKey>,
7416
7416
next_channel_outpoint: OutPoint, next_channel_id: ChannelId, next_user_channel_id: Option<u128>,
7417
7417
) {
7418
- debug_assert_eq!(
7419
- startup_replay,
7420
- !self.background_events_processed_since_startup.load(Ordering::Acquire)
7421
- );
7418
+ let startup_replay =
7419
+ !self.background_events_processed_since_startup.load(Ordering::Acquire);
7422
7420
let htlc_id = SentHTLCId::from_source(&source);
7423
7421
match source {
7424
7422
HTLCSource::OutboundRoute { session_priv, payment_id, path, .. } => {
@@ -9010,9 +9008,16 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9010
9008
hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}", counterparty_node_id), msg.channel_id))
9011
9009
}
9012
9010
};
9013
- self.claim_funds_internal(htlc_source, msg.payment_preimage.clone(),
9014
- Some(forwarded_htlc_value), skimmed_fee_msat, false, false, Some(*counterparty_node_id),
9015
- funding_txo, msg.channel_id, Some(next_user_channel_id),
9011
+ self.claim_funds_internal(
9012
+ htlc_source,
9013
+ msg.payment_preimage.clone(),
9014
+ Some(forwarded_htlc_value),
9015
+ skimmed_fee_msat,
9016
+ false,
9017
+ Some(*counterparty_node_id),
9018
+ funding_txo,
9019
+ msg.channel_id,
9020
+ Some(next_user_channel_id),
9016
9021
);
9017
9022
9018
9023
Ok(())
@@ -9565,9 +9570,17 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9565
9570
let logger = WithContext::from(&self.logger, counterparty_node_id, Some(channel_id), Some(htlc_update.payment_hash));
9566
9571
if let Some(preimage) = htlc_update.payment_preimage {
9567
9572
log_trace!(logger, "Claiming HTLC with preimage {} from our monitor", preimage);
9568
- self.claim_funds_internal(htlc_update.source, preimage,
9569
- htlc_update.htlc_value_satoshis.map(|v| v * 1000), None, true,
9570
- false, counterparty_node_id, funding_outpoint, channel_id, None);
9573
+ self.claim_funds_internal(
9574
+ htlc_update.source,
9575
+ preimage,
9576
+ htlc_update.htlc_value_satoshis.map(|v| v * 1000),
9577
+ None,
9578
+ true,
9579
+ counterparty_node_id,
9580
+ funding_outpoint,
9581
+ channel_id,
9582
+ None,
9583
+ );
9571
9584
} else {
9572
9585
log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
9573
9586
let receiver = HTLCDestination::NextHopChannel { node_id: counterparty_node_id, channel_id };
@@ -14833,9 +14846,16 @@ where
14833
14846
// We use `downstream_closed` in place of `from_onchain` here just as a guess - we
14834
14847
// don't remember in the `ChannelMonitor` where we got a preimage from, but if the
14835
14848
// channel is closed we just assume that it probably came from an on-chain claim.
14836
- channel_manager.claim_funds_internal(source, preimage, Some(downstream_value), None,
14837
- downstream_closed, true, downstream_node_id, downstream_funding,
14838
- downstream_channel_id, None
14849
+ channel_manager.claim_funds_internal(
14850
+ source,
14851
+ preimage,
14852
+ Some(downstream_value),
14853
+ None,
14854
+ downstream_closed,
14855
+ downstream_node_id,
14856
+ downstream_funding,
14857
+ downstream_channel_id,
14858
+ None,
14839
14859
);
14840
14860
}
14841
14861
0 commit comments