add lock to removeWallet

This commit is contained in:
Matias Alejo Garcia 2015-02-10 16:11:44 -03:00
parent ebc7e2e885
commit cc757f935e
1 changed files with 10 additions and 2 deletions

View File

@ -468,10 +468,18 @@ CopayServer.prototype.getTx = function(opts, cb) {
/**
* Remove wallet
* removeWallet
*
* @param opts
* @param cb
* @return {undefined}
*/
CopayServer.prototype.removeWallet = function(opts, cb) {
this.storage.removeWallet(this.walletId, cb);
var self = this;
Utils.runLocked(self.walletId, cb, function(cb) {
self.storage.removeWallet(self.walletId, cb);
});
};