exponential backoff
This commit is contained in:
parent
caafaf25f6
commit
895c52bada
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue