Merge pull request #736 from matiu/feat/timeouts

different timeouts for getutxos
This commit is contained in:
Matias Alejo Garcia 2017-11-23 10:49:39 -03:00 committed by GitHub
commit c5259a6b0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -27,10 +27,12 @@ function Lock(opts) {
}
};
Lock.prototype.runLocked = function(token, cb, task) {
Lock.prototype.runLocked = function(token, cb, task, waitTime) {
$.shouldBeDefined(token);
this.lock.locked(token, 5 * 1000, 5 * 60 * 1000, function(err, release) {
waitTime = waitTime || 5 * 1000;
this.lock.locked(token, waitTime , 5 * 60 * 1000, function(err, release) {
if (err) return cb(Errors.WALLET_BUSY);
var _cb = function() {
cb.apply(null, arguments);

View File

@ -268,9 +268,9 @@ WalletService.getInstanceWithAuth = function(opts, cb) {
return authFn(cb);
};
WalletService.prototype._runLocked = function(cb, task) {
WalletService.prototype._runLocked = function(cb, task, waitTime) {
$.checkState(this.walletId);
this.lock.runLocked(this.walletId, cb, task);
this.lock.runLocked(this.walletId, cb, task, waitTime);
};
@ -1024,7 +1024,7 @@ WalletService.prototype.createAddress = function(opts, cb) {
var createFn = wallet.singleAddress ? getFirstAddress : createNewAddress;
return createFn(wallet, cb);
});
});
}, 10 * 1000);
});
};
@ -1328,7 +1328,7 @@ WalletService.prototype._getBalanceFromAddresses = function(opts, cb, i) {
storeBalanceCache(balance, cb);
});
});
}, 10 * 1000);
});
};
@ -2320,7 +2320,7 @@ WalletService.prototype.createTx = function(opts, cb) {
});
});
});
}, 10 * 1000);
};
WalletService.prototype._verifyRequestPubKey = function(requestPubKey, signature, xPubKey) {
var pub = (new Bitcore.HDPublicKey(xPubKey)).deriveChild(Constants.PATHS.REQUEST_KEY_AUTH).publicKey;