571166cc8a
Closes #579 This is what happens when database was locked: - App is syncing. - While rustBackend.scanBlocks(…) is in progress app goes to background. Background task is launched and ECC works for some time in background. - When background task is finished synchronizer.stop() is called. - Inside CompactBlockProcessor.stop()is called. In this method cancelableTask is canceled and state is set to stopped no matter what. And this is the problem. Because even when canceled is called rust scanning isn’t canceled. But state doesn’t care about it. And next time when app is launched new synchronisation is started and now you have processing code running in two threads causing DB lock. So I moved setting state to stopped to processNewBlocks method. It's set after the work is canceled and really stopped. When doing this there is still one problem. When app goes to foreground new sync is not started and current one is just stopped. So I added new variable and condition. And when this variable is set to true new syncing process starts when the previous one is canceled. This should cover all the problems. |
||
---|---|---|
.. | ||
ZcashLightClientKit |