2018-01-26 18:04:13 +00:00
|
|
|
package network
|
|
|
|
|
|
|
|
import (
|
2019-09-09 14:54:38 +00:00
|
|
|
"net"
|
|
|
|
|
2018-02-06 06:43:32 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/network/payload"
|
2018-01-26 18:04:13 +00:00
|
|
|
)
|
|
|
|
|
2019-09-03 14:51:37 +00:00
|
|
|
// Peer represents a network node neo-go is connected to.
|
2018-01-31 08:27:08 +00:00
|
|
|
type Peer interface {
|
2019-09-09 14:54:38 +00:00
|
|
|
NetAddr() *net.TCPAddr
|
2018-03-14 09:36:59 +00:00
|
|
|
Disconnect(error)
|
2018-04-13 10:14:08 +00:00
|
|
|
WriteMsg(msg *Message) error
|
2018-03-14 09:36:59 +00:00
|
|
|
Done() chan error
|
|
|
|
Version() *payload.Version
|
2019-09-13 12:43:22 +00:00
|
|
|
Handshaked() bool
|
|
|
|
SendVersion(*Message) error
|
|
|
|
SendVersionAck(*Message) error
|
|
|
|
HandleVersion(*payload.Version) error
|
|
|
|
HandleVersionAck() error
|
2018-01-31 08:27:08 +00:00
|
|
|
}
|