code: func (p *Peer) readMessage(encoding wire.MessageEncoding) (wire.Message, []byte, error) {
  	n, msg, buf, err := wire.ReadMessageWithEncodingN(p.conn,
  		p.ProtocolVersion(), p.cfg.ChainParams.Net, encoding)
  	atomic.AddUint64(&p.bytesReceived, uint64(n))
  	if p.cfg.Listeners.OnRead != nil {
  		p.cfg.Listeners.OnRead(p, n, msg, err)
  	}
  	if err != nil {
  		return nil, nil, err
  	}
  
  	// Use closures to log expensive operations so they are only run when
  	// the logging level requires it.
  	log.Debugf("%v", newLogClosure(func() string {
  		// Debug summary of message.
  		summary := messageSummary(msg)
  		if len(summary) > 0 {
  			summary = " (" + summary + ")"
  		}
  		return fmt.Sprintf("Received %v%s from %s",
  			msg.Command(), summary, p)
  	}))
  	log.Tracef("%v", newLogClosure(func() string {
  		return spew.Sdump(msg)
  	}))
  	log.Tracef("%v", newLogClosure(func() string {
  		return spew.Sdump(buf)
  	}))
  
  	return msg, buf, nil
  }
docs: // readMessage reads the next bitcoin message from the peer with logging.