code: func (h *blockHeaderStore) blockLocatorFromHash(hash *chainhash.Hash) (
  	blockchain.BlockLocator, error) {
  
  	var locator blockchain.BlockLocator
  
  	// Append the initial hash
  	locator = append(locator, hash)
  
  	// If hash isn't found in DB or this is the genesis block, return the
  	// locator as is
  	height, err := h.heightFromHash(hash)
  	if height == 0 || err != nil {
  		return locator, nil
  	}
  
  	decrement := uint32(1)
  	for height > 0 && len(locator) < wire.MaxBlockLocatorsPerMsg {
  		// Decrement by 1 for the first 10 blocks, then double the jump
  		// until we get to the genesis hash
  		if len(locator) > 10 {
  			decrement *= 2
  		}
  
  		if decrement > height {
  			height = 0
  		} else {
  			height -= decrement
  		}
  
  		blockHeader, err := h.FetchHeaderByHeight(height)
  		if err != nil {
  			return locator, err
  		}
  		headerHash := blockHeader.BlockHash()
  
  		locator = append(locator, &headerHash)
  	}
  
  	return locator, nil
  }
docs: // blockLocatorFromHash takes a given block hash and then creates a block
  // locator using it as the root of the locator. We'll start by taking a single
  // step backwards, then keep doubling the distance until genesis after we get
  // 10 locators.
  //
  // TODO(roasbeef): make into single transaction.