-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chainnotifier: add re-org chan option to RegisterConfirmationsNtfn
With this commit we add the WithReOrgChan functional option to the RegisterConfirmationsNtfn method that allows a caller to be notified about a chain re-organization of a transaction. Using WithReOrgChan() might be a breaking change to the caller, as the behavior of the RegisterConfirmationsNtfn changes: Before, the notification channel would not continue sending updates after a confirmation event was received. When enabling WithReOrgChan(), the notification channel will continue sending updates even after a first confirmation, and will also send on the provided re-org channel if a re-org happens. After a re-org a new confirmation event is sent on the notification channel once the transaction is included in another block again. To allow a caller to reliably make sure a transaction reaches a certain safe depth in the chain, it is recommended to use RegisterConfirmationsNtfn with numConfs=1 but then keep the notification channel open until the transaction reaches the desired number of confirmations (or reac to re-org events if they happen).
- Loading branch information
Showing
1 changed file
with
49 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters