made Identity#create asynchronous
This commit is contained in:
parent
4afcad4601
commit
7e8f1a1668
3 changed files with 79 additions and 55 deletions
|
|
@ -82,10 +82,14 @@ Identity.prototype.getName = function() {
|
|||
* @param cb
|
||||
* @return {undefined}
|
||||
*/
|
||||
Identity.create = function(opts) {
|
||||
Identity.create = function(opts, cb) {
|
||||
opts = _.extend({}, opts);
|
||||
|
||||
return new Identity(opts);
|
||||
var iden = new Identity(opts);
|
||||
iden.store(opts, function(err) {
|
||||
if (err) return cb(err);
|
||||
return cb(null, iden);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -386,7 +390,9 @@ Identity.prototype.bindWallet = function(w) {
|
|||
});
|
||||
w.on('ready', function() {
|
||||
log.debug('<ready> Wallet' + w.getName());
|
||||
self.store({noWallets:true}, function() {
|
||||
self.store({
|
||||
noWallets: true
|
||||
}, function() {
|
||||
self.storeWallet(w);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue