Locator fix master ()

* 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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)
}