code: func (sm *SyncManager) limitMap(m map[chainhash.Hash]struct{}, limit int) {
  	if len(m)+1 > limit {
  		// Remove a random entry from the map.  For most compilers, Go's
  		// range statement iterates starting at a random item although
  		// that is not 100% guaranteed by the spec.  The iteration order
  		// is not important here because an adversary would have to be
  		// able to pull off preimage attacks on the hashing function in
  		// order to target eviction of specific entries anyways.
  		for txHash := range m {
  			delete(m, txHash)
  			return
  		}
  	}
  }
docs: // limitMap is a helper function for maps that require a maximum limit by
  // evicting a random transaction if adding a new value would cause it to
  // overflow the maximum allowed.