mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p: add iterator field to Protocol
This commit is contained in:
parent
14858684c8
commit
61c4079496
1 changed files with 6 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ package p2p
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/p2p/discutil"
|
||||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||||
"github.com/ethereum/go-ethereum/p2p/enr"
|
"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.
|
// but returns nil, it is assumed that the protocol handshake is still running.
|
||||||
PeerInfo func(id enode.ID) interface{}
|
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 contains protocol specific information for the node record.
|
||||||
Attributes []enr.Entry
|
Attributes []enr.Entry
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue