Skip to content

Commit 60fea3c

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 c569a0d commit 60fea3c

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
@@ -2328,6 +2328,13 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
23282328
},
23292329
}
23302330
}
2331+
2332+
// If the updates succeeded and we were in an already closed channel state, then there's no
2333+
// need to refuse any updates we expect to receive afer seeing a confirmed commitment.
2334+
if ret.is_ok() && updates.update_id == CLOSED_CHANNEL_UPDATE_ID && self.latest_update_id == updates.update_id {
2335+
return Ok(());
2336+
}
2337+
23312338
self.latest_update_id = updates.update_id;
23322339

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

0 commit comments

Comments
 (0)