From 895c52badadc37cf61c67b187ee49a63bd33f6e8 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Fri, 12 Jun 2015 16:11:42 -0300 Subject: [PATCH] exponential backoff --- lib/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server.js b/lib/server.js index 74d8c4f..4879f32 100644 --- a/lib/server.js +++ b/lib/server.js @@ -761,7 +761,7 @@ WalletService.prototype._canCreateTx = function(copayerId, cb) { var lastTxTs = txs[0].createdOn; var now = Math.floor(Date.now() / 1000); var timeSinceLastRejection = now - lastTxTs; - var backoffTime = WalletService.backoffTime * lastRejections.length; + var backoffTime = Math.pow(WalletService.backoffTime,lastRejections.length); if (timeSinceLastRejection <= backoffTime) log.debug('Not allowing to create TX: timeSinceLastRejection/backoffTime', timeSinceLastRejection, backoffTime);