diff --git a/lib/peer_client.js b/lib/peer_client.js index 71b4632..3df31dc 100644 --- a/lib/peer_client.js +++ b/lib/peer_client.js @@ -197,7 +197,7 @@ PeerClient.prototype.generateBackoff = function(attempt) { } const random = parseInt(Math.random() * this.reconnect.maxRandomOffset); - const backoff = (Math.pow(2, attempt) * this.reconnect.min); + const backoff = (2 ** attempt * this.reconnect.min); if (backoff > this.reconnect.max) { return this.reconnect.max + random; } else {