exponential backoff

This commit is contained in:
Matias Alejo Garcia 2015-06-12 16:11:42 -03:00
parent caafaf25f6
commit 895c52bada
1 changed files with 1 additions and 1 deletions

View File

@ -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);