Skip to content

Commit 08d1bfe

Browse files
committed
Drop the now-unused update_id param to monitor update macros
1 parent 224fe6b commit 08d1bfe

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
@@ -1814,7 +1814,7 @@ macro_rules! emit_channel_ready_event {
18141814
}
18151815

18161816
macro_rules! handle_monitor_update_completion {
1817-
($self: ident, $update_id: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr) => { {
1817+
($self: ident, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr) => { {
18181818
let mut updates = $chan.monitor_updating_restored(&$self.logger,
18191819
&$self.node_signer, $self.genesis_hash, &$self.default_configuration,
18201820
$self.best_block.read().unwrap().height());
@@ -1893,16 +1893,15 @@ macro_rules! handle_new_monitor_update {
18931893
},
18941894
}
18951895
} };
1896-
($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) => {
1896+
($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) => {
18971897
handle_new_monitor_update!($self, $update_res, $peer_state_lock, $peer_state,
18981898
$per_peer_state_lock, $chan, _internal, $remove,
1899-
handle_monitor_update_completion!($self, $update_id, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan))
1899+
handle_monitor_update_completion!($self, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan))
19001900
};
1901-
($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) => {
1902-
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())
1901+
($self: ident, $update_res: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan_entry: expr, INITIAL_MONITOR) => {
1902+
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())
19031903
};
19041904
($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) => { {
1905-
let update_id = $update.update_id;
19061905
let in_flight_updates = $peer_state.in_flight_monitor_updates.entry($funding_txo)
19071906
.or_insert_with(Vec::new);
19081907
in_flight_updates.push($update);
@@ -1912,7 +1911,7 @@ macro_rules! handle_new_monitor_update {
19121911
{
19131912
in_flight_updates.pop();
19141913
if in_flight_updates.is_empty() && $chan.blocked_monitor_updates_pending() == 0 {
1915-
handle_monitor_update_completion!($self, update_id, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan);
1914+
handle_monitor_update_completion!($self, $peer_state_lock, $peer_state, $per_peer_state_lock, $chan);
19161915
}
19171916
})
19181917
} };
@@ -4862,7 +4861,7 @@ where
48624861
if !channel.get().is_awaiting_monitor_update() || channel.get().context.get_latest_monitor_update_id() != highest_applied_update_id {
48634862
return;
48644863
}
4865-
handle_monitor_update_completion!(self, highest_applied_update_id, peer_state_lock, peer_state, per_peer_state, channel.get_mut());
4864+
handle_monitor_update_completion!(self, peer_state_lock, peer_state, per_peer_state, channel.get_mut());
48664865
}
48674866

48684867
/// Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
@@ -5185,7 +5184,7 @@ where
51855184
let monitor_res = self.chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
51865185

51875186
let chan = e.insert(chan);
5188-
let mut res = handle_new_monitor_update!(self, monitor_res, 0, peer_state_lock, peer_state,
5187+
let mut res = handle_new_monitor_update!(self, monitor_res, peer_state_lock, peer_state,
51895188
per_peer_state, chan, MANUALLY_REMOVING_INITIAL_MONITOR,
51905189
{ peer_state.channel_by_id.remove(&new_channel_id) });
51915190

@@ -5220,7 +5219,7 @@ where
52205219
let monitor = try_chan_entry!(self,
52215220
chan.get_mut().funding_signed(&msg, best_block, &self.signer_provider, &self.logger), chan);
52225221
let update_res = self.chain_monitor.watch_channel(chan.get().context.get_funding_txo().unwrap(), monitor);
5223-
let mut res = handle_new_monitor_update!(self, update_res, 0, peer_state_lock, peer_state, per_peer_state, chan, INITIAL_MONITOR);
5222+
let mut res = handle_new_monitor_update!(self, update_res, peer_state_lock, peer_state, per_peer_state, chan, INITIAL_MONITOR);
52245223
if let Err(MsgHandleErrInternal { ref mut shutdown_finish, .. }) = res {
52255224
// We weren't able to watch the channel to begin with, so no updates should be made on
52265225
// it. Previously, full_stack_target found an (unreachable) panic when the

0 commit comments

Comments
 (0)