v1.9.1-beta01: Fix synchronizer stop, scan loop, and SQLite isolation
- Fix SdkSynchronizer.stop() race condition: use synchronous scope.cancel() instead of async self-cancellation that never completed - Fix scan loop: scan once after all downloads complete instead of per-batch - Use fresh SQLiteDatabase connection for getLastScannedHeight() to avoid reading stale Room-cached values - Bump version to 1.9.1-beta01 - Update Cargo dependencies
This commit is contained in:
@@ -101,13 +101,13 @@ class DarksideTestCoordinator(val wallet: TestWallet) {
|
||||
twig("got processor status $it")
|
||||
if (it == Synchronizer.Status.DISCONNECTED) {
|
||||
twig("waiting a bit before giving up on connection...")
|
||||
} else if (targetHeight != null && (synchronizer as SdkSynchronizer).processor.getLastScannedHeight() < targetHeight) {
|
||||
} else if (targetHeight != null && ((synchronizer as SdkSynchronizer).processor.getLastScannedHeight() ?: synchronizer.network.saplingActivationHeight) < targetHeight) {
|
||||
twig("awaiting new blocks from server...")
|
||||
}
|
||||
}.map {
|
||||
// whenever we're waiting for a target height, for simplicity, if we're sleeping,
|
||||
// and in between polls, then consider it that we're not synced
|
||||
if (targetHeight != null && (synchronizer as SdkSynchronizer).processor.getLastScannedHeight() < targetHeight) {
|
||||
if (targetHeight != null && ((synchronizer as SdkSynchronizer).processor.getLastScannedHeight() ?: synchronizer.network.saplingActivationHeight) < targetHeight) {
|
||||
twig("switching status to DOWNLOADING because we're still waiting for height $targetHeight")
|
||||
Synchronizer.Status.DOWNLOADING
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user