1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-03-13 19:37:35 +01:00

increased max reconnection delay to 20s for peers and electrum servers

This commit is contained in:
pm47 2018-03-20 13:31:56 +01:00
parent eed7038635
commit ff34c49b4d
2 changed files with 2 additions and 2 deletions

View file

@ -133,7 +133,7 @@ class ElectrumClient(serverAddresses: Seq[InetSocketAddress]) extends Actor with
log.warning(s"connection to $remoteAddress failed, trying $nextAddress")
connectionFailures.put(remoteAddress, connectionFailures.getOrElse(remoteAddress, 0L) + 1L)
val count = connectionFailures.getOrElse(nextAddress, 0L)
val delay = Math.min(Math.pow(2.0, count), 60.0) seconds;
val delay = Math.min(Math.pow(2.0, count), 20.0) seconds;
context.system.scheduler.scheduleOnce(delay, self, Tcp.Connect(nextAddress, options = socketOptions))
}

View file

@ -51,7 +51,7 @@ class Peer(nodeParams: NodeParams, remoteNodeId: PublicKey, authenticator: Actor
case Some(address) =>
context.actorOf(Client.props(nodeParams, authenticator, address, remoteNodeId, origin_opt = None))
// exponential backoff retry with a finite max
setTimer(RECONNECT_TIMER, Reconnect, Math.min(10 + Math.pow(2, attempts), 60) seconds, repeat = false)
setTimer(RECONNECT_TIMER, Reconnect, Math.min(10 + Math.pow(2, attempts), 20) seconds, repeat = false)
stay using d.copy(attempts = attempts + 1)
}