Skip to content

Commit

Permalink
fix: Update LibWallet recovery task event handling (#3142)
Browse files Browse the repository at this point in the history
## Description
The recovery task broke out of its monitoring loop before getting the `UtxoScannerEvent::Completed` event. This PR just moves that break statement so that the final completed callback is made.

## How Has This Been Tested?
Wallet clients will need to test this

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
* [x] I'm merging against the `development` branch.
* [x] I have squashed my commits into a single commit.
  • Loading branch information
aviator-app[bot] committed Jul 28, 2021
2 parents 08f2675 + 263e87f commit 0861d72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions base_layer/wallet/tests/wallet/mod.rs
Expand Up @@ -504,6 +504,8 @@ fn test_20_store_and_forward_send_tx() {
}

#[test]
#[ignore = "Flakey on CI, theory is that it is due to SAF neighbourhoods. Retry after Kademlia style neighbourhoods \
are included"]
fn test_store_and_forward_send_tx() {
let mut shutdown_a = Shutdown::new();
let mut shutdown_b = Shutdown::new();
Expand Down
5 changes: 1 addition & 4 deletions base_layer/wallet_ffi/src/tasks.rs
Expand Up @@ -95,10 +95,6 @@ pub async fn recovery_event_monitoring(
(recovery_progress_callback)(RecoveryEvent::Progress as u8, current, total);
}
info!(target: LOG_TARGET, "Recovery progress: {}/{}", current, total);
if current == total {
info!(target: LOG_TARGET, "Recovery complete: {}/{}", current, total);
break;
}
},
Ok(UtxoScannerEvent::Completed {
number_scanned: num_scanned,
Expand All @@ -118,6 +114,7 @@ pub async fn recovery_event_monitoring(
unsafe {
(recovery_progress_callback)(RecoveryEvent::Completed as u8, num_scanned, u64::from(total_amount));
}
break;
},
Ok(UtxoScannerEvent::ScanningRoundFailed {
num_retries,
Expand Down

0 comments on commit 0861d72

Please sign in to comment.