TODO cleanup, locator made faster by header cache in chain store

This commit is contained in:
Ignotus Peverell 2018-07-13 18:44:53 +01:00
parent 41e20056d4
commit 1e7e312cf3
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211

View file

@ -352,10 +352,6 @@ fn needs_syncing(
/// Even if sync_head is significantly out of date we will "reset" it once we /// Even if sync_head is significantly out of date we will "reset" it once we
/// start getting headers back from a peer. /// start getting headers back from a peer.
/// ///
/// TODO - this gets *expensive* with a large header chain to iterate over
/// as we need to get each block header from the db
/// can we add a get_block_header_by_height(height, hash) ???
///
fn get_locator(chain: Arc<chain::Chain>) -> Result<Vec<Hash>, Error> { fn get_locator(chain: Arc<chain::Chain>) -> Result<Vec<Hash>, Error> {
let tip = chain.get_sync_head()?; let tip = chain.get_sync_head()?;
let heights = get_locator_heights(tip.height); let heights = get_locator_heights(tip.height);