Skip to content

Commit

Permalink
chain: Request block ntfns only after initial sync
Browse files Browse the repository at this point in the history
Previously, request for notifications about connected blocks were sent
to the underlying dcrd instance before the chain was fully synced.  This
could cause a race issue if the underlying dcrd instance was also
performing an initial sync, causing blocks to be connected by the
blockConnected handler before the active data filter was loaded, causing
transactions to be missed and the wallet's balance to be wrong,
requiring a rescan to be fixed.

This could happen, for example, if both the dcrd and dcrwallet processes
were started at the same time or if dcrd took just enough time to
connect to the network that the wallet was also initialized (for
exemple, from within Decrediton).

This fixes the issue by refactoring the initial sync code to only
request block notifications after the initial header sync has been
completed by the wallet.
  • Loading branch information
matheusd committed Dec 1, 2023
1 parent 66a3e69 commit bd1c46a
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 171 deletions.
Loading

0 comments on commit bd1c46a

Please sign in to comment.