mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
This commit fixes OOO notifications between backlog and non-backlog events by having the non-backlog goroutines wait on a chan that signals that backlog processing is complete. This commit also replaces usage of the canceled atomic variable with the cancelChan to signal that delivery of an event should no longer occur. Atomics do not make perfect "sequence" points as the atomic may be checked too early and the end-result of delivering to a stopped ntfnQueue is the same. Using the cancelChan ensures that we do not hang on sending to ntfnQueue.