p2p: HACK! put the dialtask directly in the queue

the server refuses to redial static peers if using
  dialstate.addstatic call

  instead the dialtask is directly appended to the queue
  this fixes the no redial problem but is clearly a hack
This commit is contained in:
zelig 2017-09-18 13:55:33 +02:00 committed by Anton Evangelatov
parent 31bae2f349
commit 955a90c1dc

View file

@ -526,7 +526,10 @@ running:
// ephemeral static peer list. Add it to the dialer, // ephemeral static peer list. Add it to the dialer,
// it will keep the node connected. // it will keep the node connected.
srv.log.Debug("Adding static node", "node", n) srv.log.Debug("Adding static node", "node", n)
dialstate.addStatic(n) // FIXME: this is a hack, redial does not work
// in simulations if addstatic is used
// dialstate.addStatic(n)
queuedTasks = append(queuedTasks, &dialTask{flags: staticDialedConn, dest: n})
case n := <-srv.removestatic: case n := <-srv.removestatic:
// This channel is used by RemovePeer to send a // This channel is used by RemovePeer to send a
// disconnect request to a peer and begin the // disconnect request to a peer and begin the