p2p: add iterator field to Protocol

This commit is contained in:
Felix Lange 2019-07-05 12:05:22 +02:00
parent 14858684c8
commit 61c4079496

View file

@ -19,6 +19,7 @@ package p2p
import (
"fmt"
"github.com/ethereum/go-ethereum/p2p/discutil"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr"
)
@ -54,6 +55,11 @@ type Protocol struct {
// but returns nil, it is assumed that the protocol handshake is still running.
PeerInfo func(id enode.ID) interface{}
// DialCandidates, if non-nil, is a way to tell Server about protocol-specific nodes
// that should be dialed. The server continuously reads nodes from the iterator and
// attempts to create connections to them.
DialCandidates discutil.Iterator
// Attributes contains protocol specific information for the node record.
Attributes []enr.Entry
}