ZcashLightClientKit/Sources/ZcashLightClientKit
Michal Fousek 571166cc8a [#579] Fix database lock
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.
2022-10-31 09:57:32 +01:00
..
Block [#579] Fix database lock 2022-10-31 09:57:32 +01:00
Constants Modify PendingTransactionEntity to be able to represent internal shielding tx. 2022-10-18 10:07:23 -06:00
DAO make Memo and MemoBytes parameters nullable so they can be omitted when sending to transparent receivers. 2022-10-24 22:49:04 -03:00
Entity Add Fee field to Transaction, ConfirmedTransaction, ReceivedTransactions and Pen 2022-10-19 17:37:06 -03:00
Extensions [#461] Adopt a Type-Safe Keys and Addresses API 2022-09-05 15:09:07 -03:00
Model make Memo and MemoBytes parameters nullable so they can be omitted when sending to transparent receivers. 2022-10-24 22:49:04 -03:00
Providers Remove dependecy on rust sources 2022-02-28 17:03:20 +00:00
Repository [#492] Get rid of blocking API (#551) 2022-10-03 20:05:11 -03:00
Resources/checkpoints Merge branch 'master' into merge-master-to-zip-316 2022-09-30 09:53:34 -03:00
Rust [#581] getTransparentBalanceForAccount error not handled 2022-10-26 20:26:37 -03:00
Service Merge branch 'master' into merge-master 2022-10-03 20:15:40 -03:00
Synchronizer Fix various tests and deleted some that are not useful anymore 2022-10-27 20:09:08 -03:00
Tool Modify PendingTransactionEntity to be able to represent internal shielding tx. 2022-10-18 10:07:23 -06:00
Transaction make Memo and MemoBytes parameters nullable so they can be omitted when sending to transparent receivers. 2022-10-24 22:49:04 -03:00
Utils [486] sendToAddress async/await 2022-09-21 13:47:17 +02:00
Initializer.swift Fix UInt32 conversions to SQL in PendingTransactionDao 2022-10-19 14:13:18 -06:00
Synchronizer.swift make Memo and MemoBytes parameters nullable so they can be omitted when sending to transparent receivers. 2022-10-24 22:49:04 -03:00