diff --git a/lib/bcoin/walletdb.js b/lib/bcoin/walletdb.js index 08c0efa1..faccc532 100644 --- a/lib/bcoin/walletdb.js +++ b/lib/bcoin/walletdb.js @@ -866,7 +866,11 @@ WalletDB.prototype.createAccount = function createAccount(options, callback) { if (exists) return callback(new Error('Account already exists.')); - account = bcoin.account.fromOptions(self, options); + try { + account = bcoin.account.fromOptions(self, options); + } catch (e) { + return callback(e); + } account.init(function(err) { if (err)