Skip to content

Commit 29a705e

Browse files
committed
Increment "validate blocks" UI task only after reading block
Previously, the counter immediately went to 100% as all the tasks were queued.
1 parent d4fafc2 commit 29a705e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/blockdir.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,9 @@ impl BlockDir {
292292
let transport = self.transport.clone();
293293
taskset.spawn(async move {
294294
// get_async_uncached checks that the hash is correct
295+
let result = get_async_uncached(&transport, hash.clone(), monitor.clone()).await;
295296
task.increment(1);
296-
match get_async_uncached(&transport, hash.clone(), monitor.clone()).await {
297+
match result {
297298
Ok(bytes) => Some((hash, bytes.len())),
298299
Err(err) => {
299300
monitor.error(err);

0 commit comments

Comments
 (0)