|
|
@ -7,6 +7,8 @@ log.disableColor(); |
|
|
|
var LocalLock = require('./locallock'); |
|
|
|
var RemoteLock = require('locker'); |
|
|
|
|
|
|
|
var Errors = require('./errors/errordefinitions'); |
|
|
|
|
|
|
|
function Lock(opts) { |
|
|
|
opts = opts || {}; |
|
|
|
if (opts.lockerServer) { |
|
|
@ -29,7 +31,7 @@ Lock.prototype.runLocked = function(token, cb, task) { |
|
|
|
$.shouldBeDefined(token); |
|
|
|
|
|
|
|
this.lock.locked(token, 5 * 1000, 24 * 60 * 60 * 1000, function(err, release) { |
|
|
|
if (err) return cb(new Error('Wallet is locked')); |
|
|
|
if (err) return cb(Errors.WALLET_LOCKED); |
|
|
|
var _cb = function() { |
|
|
|
cb.apply(null, arguments); |
|
|
|
release(); |
|
|
|