From 3186aaa6ccfa6d029096412ed42c3e1ab8222b03 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 16 Jul 2016 15:51:49 -0700 Subject: [PATCH] fix for createAccount. --- lib/bcoin/walletdb.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)