Exemplo n.º 1
0
func sendVersion(conn net.Conn) error {
	nonce++

	ver, err := wire.NewMsgVersionFromConn(conn, nonce, int32(TopResolverHeight))
	if err != nil {
		return err
	}

	return wire.WriteMessage(conn, ver, ProtocolVersion, NamecoinNet)
}
Exemplo n.º 2
0
func (p *peer) writeLoop() {
	for {
		msg := <-p.writeChan
		if !p.connected {
			return
		}

		err := wire.WriteMessage(p.conn, msg, ProtocolVersion, NamecoinNet)
		if err != nil {
			fmt.Println("Got error writing message", err)
			continue
		}
		fmt.Println("Wrote message", msg.Command())
	}
}