Skip to content

Commit 93aa776

Browse files
committed
Change sync extension to update pivot after transitioning to Full
1 parent 66f4943 commit 93aa776

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sync/src/block/downloader/header.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ impl HeaderDownloader {
6262
}
6363
}
6464

65+
pub fn update_pivot(&mut self, hash: BlockHash) {
66+
self.pivot = hash;
67+
}
68+
6569
pub fn best_hash(&self) -> BlockHash {
6670
self.best_hash
6771
}

sync/src/block/extension.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,10 @@ impl Extension {
10481048

10491049
fn transition_to_full(&mut self) {
10501050
cdebug!(SYNC, "Transitioning state to {:?}", State::Full);
1051+
let best_hash = self.client.best_block_header().hash();
1052+
for downloader in self.header_downloaders.values_mut() {
1053+
downloader.update_pivot(best_hash);
1054+
}
10511055
self.state = State::Full;
10521056
}
10531057
}

0 commit comments

Comments
 (0)