Locator fix master (#381)

* fix chain_header_by_height error

* cherry-pick and clean up
This commit is contained in:
Yeastplume
2017-11-23 11:11:35 +00:00
committed by GitHub
parent 25969424ff
commit 77eac16702
+3 -6
View File
@@ -283,14 +283,11 @@ impl Syncer {
let locator = heights
.into_iter()
.map(|h| {
let header = self.chain.get_header_by_height(h).unwrap();
header.hash()
})
.map(|h| self.chain.get_header_by_height(h))
.filter(|h| h.is_ok())
.map(|h| h.unwrap().hash())
.collect();
debug!(LOGGER, "Sync: locator: {:?}", locator);
Ok(locator)
}