diff options
author | Firescar96 <nchinda2@gmail.com> | 2016-06-25 04:27:55 +0800 |
---|---|---|
committer | Firescar96 <nchinda2@gmail.com> | 2016-07-15 06:51:41 +0800 |
commit | 4c3da0f2e1063ccb32933faff4601d5f5e0f987c (patch) | |
tree | eacf53fbbf7f920794ea0ebd13661c90124b262a /p2p/dial.go | |
parent | e0493457d5a9d280554990b5a29c4fcad69e7d0b (diff) | |
download | dexon-4c3da0f2e1063ccb32933faff4601d5f5e0f987c.tar.gz dexon-4c3da0f2e1063ccb32933faff4601d5f5e0f987c.tar.zst dexon-4c3da0f2e1063ccb32933faff4601d5f5e0f987c.zip |
node, p2p, internal: Add ability to remove peers via admin interface
Diffstat (limited to 'p2p/dial.go')
-rw-r--r-- | p2p/dial.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/p2p/dial.go b/p2p/dial.go index c0e703d7d..691b8539e 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -121,6 +121,11 @@ func (s *dialstate) addStatic(n *discover.Node) { s.static[n.ID] = &dialTask{flags: staticDialedConn, dest: n} } +func (s *dialstate) removeStatic(n *discover.Node) { + // This removes a task so future attempts to connect will not be made. + delete(s.static, n.ID) +} + func (s *dialstate) newTasks(nRunning int, peers map[discover.NodeID]*Peer, now time.Time) []task { var newtasks []task isDialing := func(id discover.NodeID) bool { |