mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 13:58:05 +00:00
76c7cff67f
Don't accept other messages before handshake is completed, check handshake message sequence.
21 lines
436 B
Go
21 lines
436 B
Go
package network
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/CityOfZion/neo-go/pkg/network/payload"
|
|
)
|
|
|
|
// Peer represents a network node neo-go is connected to.
|
|
type Peer interface {
|
|
NetAddr() *net.TCPAddr
|
|
Disconnect(error)
|
|
WriteMsg(msg *Message) error
|
|
Done() chan error
|
|
Version() *payload.Version
|
|
Handshaked() bool
|
|
SendVersion(*Message) error
|
|
SendVersionAck(*Message) error
|
|
HandleVersion(*payload.Version) error
|
|
HandleVersionAck() error
|
|
}
|