code: func newPeerConfig(sp *serverPeer) *peer.Config {
  	return &peer.Config{
  		Listeners: peer.MessageListeners{
  			OnVersion:      sp.OnVersion,
  			OnMemPool:      sp.OnMemPool,
  			OnTx:           sp.OnTx,
  			OnBlock:        sp.OnBlock,
  			OnInv:          sp.OnInv,
  			OnHeaders:      sp.OnHeaders,
  			OnGetData:      sp.OnGetData,
  			OnGetBlocks:    sp.OnGetBlocks,
  			OnGetHeaders:   sp.OnGetHeaders,
  			OnGetCFilters:  sp.OnGetCFilters,
  			OnGetCFHeaders: sp.OnGetCFHeaders,
  			OnGetCFCheckpt: sp.OnGetCFCheckpt,
  			OnFeeFilter:    sp.OnFeeFilter,
  			OnFilterAdd:    sp.OnFilterAdd,
  			OnFilterClear:  sp.OnFilterClear,
  			OnFilterLoad:   sp.OnFilterLoad,
  			OnGetAddr:      sp.OnGetAddr,
  			OnAddr:         sp.OnAddr,
  			OnRead:         sp.OnRead,
  			OnWrite:        sp.OnWrite,
  
  			// Note: The reference client currently bans peers that send alerts
  			// not signed with its key.  We could verify against their key, but
  			// since the reference client is currently unwilling to support
  			// other implementations' alert messages, we will not relay theirs.
  			OnAlert: nil,
  		},
  		NewestBlock:       sp.newestBlock,
  		HostToNetAddress:  sp.server.addrManager.HostToNetAddress,
  		Proxy:             cfg.Proxy,
  		UserAgentName:     userAgentName,
  		UserAgentVersion:  userAgentVersion,
  		UserAgentComments: cfg.UserAgentComments,
  		ChainParams:       sp.server.chainParams,
  		Services:          sp.server.services,
  		DisableRelayTx:    cfg.BlocksOnly,
  		ProtocolVersion:   peer.MaxProtocolVersion,
  		TrickleInterval:   cfg.TrickleInterval,
  	}
  }
docs: // newPeerConfig returns the configuration for the given serverPeer.