13 lines
436 B
Go
13 lines
436 B
Go
package p2p
|
|
|
|
// Peer is the interface that any network participant must implement.
|
|
// Both honest nodes and attackers implement this — the network doesn't know the difference.
|
|
type Peer interface {
|
|
// Receive delivers a message to this peer (network layer).
|
|
Receive(msg Msg)
|
|
// ReceiveSync delivers a sync message (block sync protocol).
|
|
ReceiveSync(msg Msg)
|
|
// ShortID returns a short identifier for logging.
|
|
ShortID() string
|
|
}
|