aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/dial.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-07-29 18:34:28 +0800
committerGitHub <noreply@github.com>2016-07-29 18:34:28 +0800
commitb8ba80bff70bedb59385e35f11de18679f3b4967 (patch)
tree41031b7d529ce302f45770c63ec5827a99d4bd5b /p2p/dial.go
parent8ec6ccc54d1da7bbaa87bd0b489b1778ea729c90 (diff)
parent4c3da0f2e1063ccb32933faff4601d5f5e0f987c (diff)
downloaddexon-b8ba80bff70bedb59385e35f11de18679f3b4967.tar.gz
dexon-b8ba80bff70bedb59385e35f11de18679f3b4967.tar.zst
dexon-b8ba80bff70bedb59385e35f11de18679f3b4967.zip
Merge pull request #2740 from Firescar96/removepeer
node, p2p, internal: Add ability to remove peers via admin interface
Diffstat (limited to 'p2p/dial.go')
-rw-r--r--p2p/dial.go5
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 {