Skip to content

Commit

Permalink
fix(polling): only run full sync on first iteration (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Apr 8, 2021
1 parent f5fd861 commit 3ebc2b9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/account_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1307,12 +1307,10 @@ async fn poll(
) -> crate::Result<PollResponse> {
let mut synchronizer =
AccountsSynchronizer::new(sync_accounts_lock, accounts.clone(), storage_file_path, account_options);
if !first_iteration {
synchronizer = synchronizer
.skip_account_discovery()
.skip_change_addresses()
.address_index(0)
.gap_limit(10);
if first_iteration {
synchronizer = synchronizer.address_index(0).gap_limit(10);
} else {
synchronizer = synchronizer.skip_account_discovery().skip_change_addresses();
}
let synced_accounts = synchronizer.execute().await?;

Expand Down

0 comments on commit 3ebc2b9

Please sign in to comment.