@@ -2307,7 +2307,7 @@ macro_rules! handle_new_monitor_update {
2307
2307
in_flight_updates.push($update);
2308
2308
in_flight_updates.len() - 1
2309
2309
});
2310
- let update_res = $self.chain_monitor.update_channel($funding_txo, $channel_id, &in_flight_updates[idx]);
2310
+ let update_res = $self.chain_monitor.update_channel($funding_txo, &in_flight_updates[idx]);
2311
2311
handle_new_monitor_update!($self, update_res, $chan, _internal,
2312
2312
{
2313
2313
let _ = in_flight_updates.remove(idx);
@@ -2864,12 +2864,12 @@ where
2864
2864
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
2865
2865
self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
2866
2866
}
2867
- if let Some((_, funding_txo, channel_id , monitor_update)) = shutdown_res.monitor_update {
2867
+ if let Some((_, funding_txo, _channel_id , monitor_update)) = shutdown_res.monitor_update {
2868
2868
// There isn't anything we can do if we get an update failure - we're already
2869
2869
// force-closing. The monitor update on the required in-memory copy should broadcast
2870
2870
// the latest local state, which is the best we can do anyway. Thus, it is safe to
2871
2871
// ignore the result here.
2872
- let _ = self.chain_monitor.update_channel(funding_txo, channel_id, &monitor_update);
2872
+ let _ = self.chain_monitor.update_channel(funding_txo, &monitor_update);
2873
2873
}
2874
2874
let mut shutdown_results = Vec::new();
2875
2875
if let Some(txid) = shutdown_res.unbroadcasted_batch_funding_txid {
@@ -3404,7 +3404,6 @@ where
3404
3404
return Err(APIError::ChannelUnavailable{err: "Peer for first hop currently disconnected".to_owned()});
3405
3405
}
3406
3406
let funding_txo = chan.context.get_funding_txo().unwrap();
3407
- let channel_id = chan.context.channel_id();
3408
3407
let logger = WithChannelContext::from(&self.logger, &chan.context);
3409
3408
let send_res = chan.send_htlc_and_commit(htlc_msat, payment_hash.clone(),
3410
3409
htlc_cltv, HTLCSource::OutboundRoute {
@@ -4755,10 +4754,10 @@ where
4755
4754
4756
4755
for event in background_events.drain(..) {
4757
4756
match event {
4758
- BackgroundEvent::ClosedMonitorUpdateRegeneratedOnStartup((funding_txo, channel_id , update)) => {
4757
+ BackgroundEvent::ClosedMonitorUpdateRegeneratedOnStartup((funding_txo, _channel_id , update)) => {
4759
4758
// The channel has already been closed, so no use bothering to care about the
4760
4759
// monitor updating completing.
4761
- let _ = self.chain_monitor.update_channel(funding_txo, channel_id, &update);
4760
+ let _ = self.chain_monitor.update_channel(funding_txo, &update);
4762
4761
},
4763
4762
BackgroundEvent::MonitorUpdateRegeneratedOnStartup { counterparty_node_id, funding_txo, channel_id, update } => {
4764
4763
let mut updated_chan = false;
@@ -4783,7 +4782,7 @@ where
4783
4782
}
4784
4783
if !updated_chan {
4785
4784
// TODO: Track this as in-flight even though the channel is closed.
4786
- let _ = self.chain_monitor.update_channel(funding_txo, channel_id, &update);
4785
+ let _ = self.chain_monitor.update_channel(funding_txo, &update);
4787
4786
}
4788
4787
},
4789
4788
BackgroundEvent::MonitorUpdatesComplete { counterparty_node_id, channel_id } => {
@@ -5645,14 +5644,13 @@ where
5645
5644
updates: vec![ChannelMonitorUpdateStep::PaymentPreimage {
5646
5645
payment_preimage,
5647
5646
}],
5647
+ channel_id: Some(prev_hop.channel_id),
5648
5648
};
5649
5649
5650
- let prev_hop_channel_id = prev_hop.channel_id;
5651
-
5652
5650
if !during_init {
5653
5651
// We update the ChannelMonitor on the backward link, after
5654
5652
// receiving an `update_fulfill_htlc` from the forward link.
5655
- let update_res = self.chain_monitor.update_channel(prev_hop.outpoint, prev_hop_channel_id, &preimage_update);
5653
+ let update_res = self.chain_monitor.update_channel(prev_hop.outpoint, &preimage_update);
5656
5654
if update_res != ChannelMonitorUpdateStatus::Completed {
5657
5655
// TODO: This needs to be handled somehow - if we receive a monitor update
5658
5656
// with a preimage we *must* somehow manage to propagate it to the upstream
@@ -10459,6 +10457,7 @@ where
10459
10457
update_id: CLOSED_CHANNEL_UPDATE_ID,
10460
10458
counterparty_node_id: None,
10461
10459
updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed { should_broadcast: true }],
10460
+ channel_id: Some(monitor.channel_id()),
10462
10461
};
10463
10462
close_background_events.push(BackgroundEvent::ClosedMonitorUpdateRegeneratedOnStartup((*funding_txo, channel_id, monitor_update)));
10464
10463
}
0 commit comments