blockchain sandbox: UTXO chain, p2p mining, attacker node
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user