mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-12 05:42:25 +01:00
When iterating with the ChainNotifier, it currently isn’t possible to cancel a non-dispatched yet active notificaiton intent. As a result, this can be rather wasteful in many parts of lnd which my repeatedly create a new spend notification depending on if/when a peer is connected or not. In order to fix this, we add a new `Cancel func()` field to both the `BlockEpochEvent` and `SpendEvent` structs. This new closure attribute allows the caller to cancel the yet-to-be-dispathed event, allowing the ChainNotifier to free up resources.
8.6 KiB
8.6 KiB