Skip to content

Commit 7f06757

Browse files
committed
Drop the now-unused update_id param to monitor update macros
1 parent fd70e58 commit 7f06757

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lightning/src/ln/channelmanager.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ macro_rules! emit_channel_ready_event {
18191819
}
18201820

18211821
macro_rules! handle_monitor_update_completion {
1822-
($self: ident, $update_id: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr) => { {
1822+
($self: ident, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr) => { {
18231823
let mut updates = $chan.monitor_updating_restored(&$self.logger,
18241824
&$self.node_signer, $self.genesis_hash, &$self.default_configuration,
18251825
$self.best_block.read().unwrap().height());
@@ -1898,16 +1898,15 @@ macro_rules! handle_new_monitor_update {
18981898
},
18991899
}
19001900
} };
1901-
($self: ident, $update_res: expr, $update_id: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr, MANUALLY_REMOVING_INITIAL_MONITOR, $remove: expr) => {
1901+
($self: ident, $update_res: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr, MANUALLY_REMOVING_INITIAL_MONITOR, $remove: expr) => {
19021902
handle_new_monitor_update!($self, $update_res, $peer_state_lock, $peer_state,
19031903
$per_peer_state_lock, $chan, _internal, $remove,
1904-
handle_monitor_update_completion!($self, $update_id, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan))
1904+
handle_monitor_update_completion!($self, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan))
19051905
};
1906-
($self: ident, $update_res: expr, $update_id: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan_entry: expr, INITIAL_MONITOR) => {
1907-
handle_new_monitor_update!($self, $update_res, $update_id, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan_entry.get_mut(), MANUALLY_REMOVING_INITIAL_MONITOR, $chan_entry.remove_entry())
1906+
($self: ident, $update_res: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan_entry: expr, INITIAL_MONITOR) => {
1907+
handle_new_monitor_update!($self, $update_res, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan_entry.get_mut(), MANUALLY_REMOVING_INITIAL_MONITOR, $chan_entry.remove_entry())
19081908
};
19091909
($self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr, MANUALLY_REMOVING, $remove: expr) => { {
1910-
let update_id = $update.update_id;
19111910
let in_flight_updates = $peer_state.in_flight_monitor_updates.entry($funding_txo)
19121911
.or_insert_with(Vec::new);
19131912
// During startup, we push monitor updates as background events through to here in
@@ -1924,7 +1923,7 @@ macro_rules! handle_new_monitor_update {
19241923
{
19251924
in_flight_updates.pop();
19261925
if in_flight_updates.is_empty() && $chan.blocked_monitor_updates_pending() == 0 {
1927-
handle_monitor_update_completion!($self, update_id, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan);
1926+
handle_monitor_update_completion!($self, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan);
19281927
}
19291928
})
19301929
} };
@@ -4934,7 +4933,7 @@ where
49344933
if !channel.get().is_awaiting_monitor_update() || channel.get().context.get_latest_monitor_update_id() != highest_applied_update_id {
49354934
return;
49364935
}
4937-
handle_monitor_update_completion!(self, highest_applied_update_id, peer_state_lock, peer_state, per_peer_state, channel.get_mut());
4936+
handle_monitor_update_completion!(self, peer_state_lock, peer_state, per_peer_state, channel.get_mut());
49384937
}
49394938

49404939
/// Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
@@ -5257,7 +5256,7 @@ where
52575256
let monitor_res = self.chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
52585257

52595258
let chan = e.insert(chan);
5260-
let mut res = handle_new_monitor_update!(self, monitor_res, 0, peer_state_lock, peer_state,
5259+
let mut res = handle_new_monitor_update!(self, monitor_res, peer_state_lock, peer_state,
52615260
per_peer_state, chan, MANUALLY_REMOVING_INITIAL_MONITOR,
52625261
{ peer_state.channel_by_id.remove(&new_channel_id) });
52635262

@@ -5292,7 +5291,7 @@ where
52925291
let monitor = try_chan_entry!(self,
52935292
chan.get_mut().funding_signed(&msg, best_block, &self.signer_provider, &self.logger), chan);
52945293
let update_res = self.chain_monitor.watch_channel(chan.get().context.get_funding_txo().unwrap(), monitor);
5295-
let mut res = handle_new_monitor_update!(self, update_res, 0, peer_state_lock, peer_state, per_peer_state, chan, INITIAL_MONITOR);
5294+
let mut res = handle_new_monitor_update!(self, update_res, peer_state_lock, peer_state, per_peer_state, chan, INITIAL_MONITOR);
52965295
if let Err(MsgHandleErrInternal { ref mut shutdown_finish, .. }) = res {
52975296
// We weren't able to watch the channel to begin with, so no updates should be made on
52985297
// it. Previously, full_stack_target found an (unreachable) panic when the

0 commit comments

Comments
 (0)