Skip to content

Commit 6e5b996

Browse files
foriequal0remagpie
authored andcommitted
Change sync extension to update pivot after transitioning to Full
1 parent 3761a44 commit 6e5b996

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
@@ -1044,6 +1044,10 @@ impl Extension {
10441044

10451045
fn transition_to_full(&mut self) {
10461046
cdebug!(SYNC, "Transitioning state to {:?}", State::Full);
1047+
let best_hash = self.client.best_block_header().hash();
1048+
for downloader in self.header_downloaders.values_mut() {
1049+
downloader.update_pivot(best_hash);
1050+
}
10471051
self.state = State::Full;
10481052
}
10491053
}

0 commit comments

Comments
 (0)