Merge pull request #1946 from isocolsky/prevent_multijoin

returning error when allet already exists in profile
This commit is contained in:
Matias Alejo Garcia 2014-12-04 14:47:11 -03:00
commit db429a3dc5
4 changed files with 16 additions and 2 deletions

View file

@ -575,6 +575,13 @@ Identity.prototype.createWallet = function(opts, cb) {
var self = this;
var w = new walletClass(opts);
console.log(_.keys(self.wallets));
console.log(w.getId());
if (_.contains(_.keys(self.wallets), w.getId())) {
return cb('walletAlreadyExists');
}
self.wallets[w.getId()] = w;
self.updateFocusedTimestamp(w.getId());
self.bindWallet(w);