Skip to content

Commit 00cfc6b

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 bd4eb0d commit 00cfc6b

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
@@ -2373,6 +2373,13 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
23732373
},
23742374
}
23752375
}
2376+
2377+
// If the updates succeeded and we were in an already closed channel state, then there's no
2378+
// need to refuse any updates we expect to receive afer seeing a confirmed commitment.
2379+
if ret.is_ok() && updates.update_id == CLOSED_CHANNEL_UPDATE_ID && self.latest_update_id == updates.update_id {
2380+
return Ok(());
2381+
}
2382+
23762383
self.latest_update_id = updates.update_id;
23772384

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

0 commit comments

Comments
 (0)