code: func (s *SigCache) Add(sigHash chainhash.Hash, sig *btcec.Signature, pubKey *btcec.PublicKey) {
  	s.Lock()
  	defer s.Unlock()
  
  	if s.maxEntries <= 0 {
  		return
  	}
  
  	// If adding this new entry will put us over the max number of allowed
  	// entries, then evict an entry.
  	if uint(len(s.validSigs)+1) > s.maxEntries {
  		// Remove a random entry from the map. Relying on the random
  		// starting point of Go's map iteration. It's worth noting that
  		// the random iteration starting point is not 100% guaranteed
  		// by the spec, however most Go compilers support it.
  		// Ultimately, the iteration order isn't important here because
  		// in order to manipulate which items are evicted, an adversary
  		// would need to be able to execute preimage attacks on the
  		// hashing function in order to start eviction at a specific
  		// entry.
  		for sigEntry := range s.validSigs {
  			delete(s.validSigs, sigEntry)
  			break
  		}
  	}
  	s.validSigs[sigHash] = sigCacheEntry{sig, pubKey}
  }
docs: // Add adds an entry for a signature over 'sigHash' under public key 'pubKey'
  // to the signature cache. In the event that the SigCache is 'full', an
  // existing entry is randomly chosen to be evicted in order to make space for
  // the new entry.
  //
  // NOTE: This function is safe for concurrent access. Writers will block
  // simultaneous readers until function execution has concluded.