Skip to content

Commit f7c88eb

Browse files
committed
Avoid refusing ChannelMonitorUpdates we expect to receive after closing
There is no need to fill the user's logs with errors that are expected to be hit based on specific edge cases, like providing preimages after a monitor has seen a confirmed commitment on-chain. This doesn't really change our behavior – we still apply and persist the state changes resulting from processing these updates regardless of whether they succeed or not.
1 parent e254f94 commit f7c88eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,6 +2370,13 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
23702370
},
23712371
}
23722372
}
2373+
2374+
// If the updates succeeded and we were in an already closed channel state, then there's no
2375+
// need to refuse any updates we expect to receive afer seeing a confirmed commitment.
2376+
if ret.is_ok() && updates.update_id == CLOSED_CHANNEL_UPDATE_ID && self.latest_update_id == updates.update_id {
2377+
return Ok(());
2378+
}
2379+
23732380
self.latest_update_id = updates.update_id;
23742381

23752382
if ret.is_ok() && self.funding_spend_seen {

0 commit comments

Comments
 (0)