mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Build index header by height after fast sync (#925)
Make sure that all headers are indexed
This commit is contained in:
parent
85ee5041aa
commit
ac979d021d
2 changed files with 1 additions and 1 deletions
|
@ -561,6 +561,7 @@ impl Chain {
|
||||||
*head = Tip::from_block(&header);
|
*head = Tip::from_block(&header);
|
||||||
let _ = self.store.save_body_head(&head);
|
let _ = self.store.save_body_head(&head);
|
||||||
self.store.save_header_height(&header)?;
|
self.store.save_header_height(&header)?;
|
||||||
|
self.store.build_by_height_index(&header, true)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.check_orphans(header.hash());
|
self.check_orphans(header.hash());
|
||||||
|
|
|
@ -265,7 +265,6 @@ fn simulate_fast_sync() {
|
||||||
while s2.head().height != s2.header_head().height || s2.head().height < 20 {
|
while s2.head().height != s2.header_head().height || s2.head().height < 20 {
|
||||||
thread::sleep(time::Duration::from_millis(1000));
|
thread::sleep(time::Duration::from_millis(1000));
|
||||||
}
|
}
|
||||||
s2.chain.rebuild_header_by_height();
|
|
||||||
let h2 = s2.chain.get_header_by_height(1).unwrap();
|
let h2 = s2.chain.get_header_by_height(1).unwrap();
|
||||||
|
|
||||||
s1.stop();
|
s1.stop();
|
||||||
|
|
Loading…
Reference in a new issue