mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
fix: no need switching to HeaderSync in FastSync states (#1622)
* fix: no need switching to HeaderSync in FastSync states
This commit is contained in:
parent
6d67cbdecb
commit
d7fbeb2c62
1 changed files with 6 additions and 6 deletions
|
@ -199,8 +199,8 @@ fn do_header_sync(
|
|||
) {
|
||||
let status = sync_state.status();
|
||||
|
||||
let update_sync_state = match status {
|
||||
SyncStatus::TxHashsetDownload => false,
|
||||
let enable_header_sync = match status {
|
||||
SyncStatus::BodySync { .. } | SyncStatus::HeaderSync { .. } => true,
|
||||
SyncStatus::NoSync | SyncStatus::Initial => {
|
||||
// Reset sync_head to header_head on transition to HeaderSync,
|
||||
// but ONLY on initial transition to HeaderSync state.
|
||||
|
@ -217,18 +217,18 @@ fn do_header_sync(
|
|||
history_locators.clear();
|
||||
true
|
||||
}
|
||||
_ => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
if update_sync_state {
|
||||
if enable_header_sync {
|
||||
sync_state.update(SyncStatus::HeaderSync {
|
||||
current_height: header_head.height,
|
||||
highest_height: si.highest_height,
|
||||
});
|
||||
}
|
||||
|
||||
header_sync(peers, chain, history_locators);
|
||||
}
|
||||
}
|
||||
|
||||
fn do_fast_sync(
|
||||
sync_state: &SyncState,
|
||||
|
|
Loading…
Reference in a new issue