code: func (f *lightFetcher) peerHasBlock(p *peer, hash common.Hash, number uint64, hasState bool) bool {
  	f.lock.Lock()
  	defer f.lock.Unlock()
  
  	fp := f.peers[p]
  	if fp == nil || fp.root == nil {
  		return false
  	}
  
  	if hasState {
  		if fp.lastAnnounced == nil || fp.lastAnnounced.number > number+serverStateAvailable {
  			return false
  		}
  	}
  
  	if f.syncing {
  		// always return true when syncing
  		// false positives are acceptable, a more sophisticated condition can be implemented later
  		return true
  	}
  
  	if number >= fp.root.number {
  		// it is recent enough that if it is known, is should be in the peer's block tree
  		return fp.nodeByHash[hash] != nil
  	}
  	f.chain.LockChain()
  	defer f.chain.UnlockChain()
  	// if it's older than the peer's block tree root but it's in the same canonical chain
  	// as the root, we can still be sure the peer knows it
  	//
  	// when syncing, just check if it is part of the known chain, there is nothing better we
  	// can do since we do not know the most recent block hash yet
  	return rawdb.ReadCanonicalHash(f.pm.chainDb, fp.root.number) == fp.root.hash && rawdb.ReadCanonicalHash(f.pm.chainDb, number) == hash
  }
docs: // peerHasBlock returns true if we can assume the peer knows the given block
  // based on its announcements