Is there a way to cancel an ongoing sync? #1000
-
Specifically with the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
With the pre-1.0 sync there's no way to stop it while it's syncing. But post 1.0 you'll have more control of how and when to sync and store updates. For 1.0 there is a three step process, 1. scan the blockchain for wallet updates, access to Wallet isn't blocked, and 2. apply updates to the in memory Wallet indexes, a quick operation, 3. if any updates changed the Wallet, persist those to your DB, this should also be quick and not block access to the Wallet. The PR #976 includes examples for syncing with electrum and esplora. |
Beta Was this translation helpful? Give feedback.
-
Considering this discussion, I wrote an SQLx Postgres as a wallet DB right from the SQLite implementation. So I use an How bad can it be when an address is being generated in a wallet object whereas a wallet sync is ongoing in another wallet object on a different thread? |
Beta Was this translation helpful? Give feedback.
With the pre-1.0 sync there's no way to stop it while it's syncing. But post 1.0 you'll have more control of how and when to sync and store updates. For 1.0 there is a three step process, 1. scan the blockchain for wallet updates, access to Wallet isn't blocked, and 2. apply updates to the in memory Wallet indexes, a quick operation, 3. if any updates changed the Wallet, persist those to your DB, this should also be quick and not block access to the Wallet. The PR #976 includes examples for syncing with electrum and esplora.