You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
0 commit comments