mirror of
https://github.com/mimblewimble/grin.git
synced 2025-03-14 13:01:09 +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 status = sync_state.status();
|
||||||
|
|
||||||
let update_sync_state = match status {
|
let enable_header_sync = match status {
|
||||||
SyncStatus::TxHashsetDownload => false,
|
SyncStatus::BodySync { .. } | SyncStatus::HeaderSync { .. } => true,
|
||||||
SyncStatus::NoSync | SyncStatus::Initial => {
|
SyncStatus::NoSync | SyncStatus::Initial => {
|
||||||
// Reset sync_head to header_head on transition to HeaderSync,
|
// Reset sync_head to header_head on transition to HeaderSync,
|
||||||
// but ONLY on initial transition to HeaderSync state.
|
// but ONLY on initial transition to HeaderSync state.
|
||||||
|
@ -217,17 +217,17 @@ fn do_header_sync(
|
||||||
history_locators.clear();
|
history_locators.clear();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
_ => true,
|
_ => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
if update_sync_state {
|
if enable_header_sync {
|
||||||
sync_state.update(SyncStatus::HeaderSync {
|
sync_state.update(SyncStatus::HeaderSync {
|
||||||
current_height: header_head.height,
|
current_height: header_head.height,
|
||||||
highest_height: si.highest_height,
|
highest_height: si.highest_height,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
header_sync(peers, chain, history_locators);
|
header_sync(peers, chain, history_locators);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_fast_sync(
|
fn do_fast_sync(
|
||||||
|
|
Loading…
Reference in a new issue