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:
parent
eed7038635
commit
ff34c49b4d
2 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue