code: func (p *Peer) isAllowedReadError(err error) bool {
  	// Only allow read errors in regression test mode.
  	if p.cfg.ChainParams.Net != wire.TestNet {
  		return false
  	}
  
  	// Don't allow the error if it's not specifically a malformed message error.
  	if _, ok := err.(*wire.MessageError); !ok {
  		return false
  	}
  
  	// Don't allow the error if it's not coming from localhost or the
  	// hostname can't be determined for some reason.
  	host, _, err := net.SplitHostPort(p.addr)
  	if err != nil {
  		return false
  	}
  
  	if host != "127.0.0.1" && host != "localhost" {
  		return false
  	}
  
  	// Allowed if all checks passed.
  	return true
  }
docs: // isAllowedReadError returns whether or not the passed error is allowed without
  // disconnecting the peer.  In particular, regression tests need to be allowed
  // to send malformed messages without the peer being disconnected.