aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/simulation/events.go
diff options
context:
space:
mode:
authorJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
committerJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
commit24349144b6c0642755569268bab56b9033743212 (patch)
tree9d9d2b6659fd8a56512dfc807aafe4b733165ae1 /swarm/network/simulation/events.go
parent7d56602391e155e2ce9ba7c261300a1804ab9972 (diff)
parentd3441ebb563439bac0837d70591f92e2c6080303 (diff)
downloadgo-tangerine-24349144b6c0642755569268bab56b9033743212.tar
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.gz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.bz2
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.lz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.xz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.zst
go-tangerine-24349144b6c0642755569268bab56b9033743212.zip
Merge branch 'master' into max-stream-peer-servers
Diffstat (limited to 'swarm/network/simulation/events.go')
-rw-r--r--swarm/network/simulation/events.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/swarm/network/simulation/events.go b/swarm/network/simulation/events.go
index 980a9a756..594d36225 100644
--- a/swarm/network/simulation/events.go
+++ b/swarm/network/simulation/events.go
@@ -20,15 +20,14 @@ import (
"context"
"sync"
- "github.com/ethereum/go-ethereum/p2p/discover"
-
"github.com/ethereum/go-ethereum/p2p"
+ "github.com/ethereum/go-ethereum/p2p/enode"
)
// PeerEvent is the type of the channel returned by Simulation.PeerEvents.
type PeerEvent struct {
// NodeID is the ID of node that the event is caught on.
- NodeID discover.NodeID
+ NodeID enode.ID
// Event is the event that is caught.
Event *p2p.PeerEvent
// Error is the error that may have happened during event watching.
@@ -69,7 +68,7 @@ func (f *PeerEventsFilter) MsgCode(c uint64) *PeerEventsFilter {
// PeerEvents returns a channel of events that are captured by admin peerEvents
// subscription nodes with provided NodeIDs. Additional filters can be set to ignore
// events that are not relevant.
-func (s *Simulation) PeerEvents(ctx context.Context, ids []discover.NodeID, filters ...*PeerEventsFilter) <-chan PeerEvent {
+func (s *Simulation) PeerEvents(ctx context.Context, ids []enode.ID, filters ...*PeerEventsFilter) <-chan PeerEvent {
eventC := make(chan PeerEvent)
// wait group to make sure all subscriptions to admin peerEvents are established
@@ -78,7 +77,7 @@ func (s *Simulation) PeerEvents(ctx context.Context, ids []discover.NodeID, filt
for _, id := range ids {
s.shutdownWG.Add(1)
subsWG.Add(1)
- go func(id discover.NodeID) {
+ go func(id enode.ID) {
defer s.shutdownWG.Done()
client, err := s.Net.GetNode(id).Client()