node, p2p, internal: Add ability to remove peers via admin interface

This commit is contained in:
Firescar96
2016-06-24 16:27:55 -04:00
parent e0493457d5
commit 4c3da0f2e1
5 changed files with 48 additions and 0 deletions

View File

@ -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 {