Skip to content

Commit

Permalink
Consensys#182: createVault function will now send error in callback i…
Browse files Browse the repository at this point in the history
…f invalid mnemonic occurs
  • Loading branch information
Abhiram Hatolkar committed Apr 10, 2018
1 parent b7b2d96 commit 579aea2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/keystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ KeyStore.createVault = function(opts, cb) {
if (err) return cb(err);

var ks = new KeyStore();
ks.init(opts.seedPhrase, pwDerivedKey, opts.hdPathString, opts.salt);

cb(null, ks);
try{
ks.init(opts.seedPhrase, pwDerivedKey, opts.hdPathString, opts.salt);
cb(null, ks);
} catch(err) {
cb(err, null);
}
});
};

Expand Down

0 comments on commit 579aea2

Please sign in to comment.