From 370b5aeb24c37ac75ca6118233c3c8a3cafbbbaa Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 17 May 2016 15:25:39 -0700 Subject: [PATCH] hd. --- lib/bcoin/hd.js | 9 +++++---- lib/bcoin/protocol/constants.js | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/bcoin/hd.js b/lib/bcoin/hd.js index 76e84790..13be978a 100644 --- a/lib/bcoin/hd.js +++ b/lib/bcoin/hd.js @@ -366,11 +366,12 @@ HD.parsePath = function parsePath(path, max) { if (max == null) max = constants.hd.MAX_INDEX; - if (constants.hd.PATH_ROOTS.indexOf(path) !== -1) - return result; - - if (constants.hd.PATH_ROOTS.indexOf(root) === -1) + if (root !== 'm' + && root !== 'M' + && root !== 'm\'' + && root !== 'M\'') { throw new Error('Bad path root.'); + } for (i = 0; i < parts.length; i++) { index = parts[i]; diff --git a/lib/bcoin/protocol/constants.js b/lib/bcoin/protocol/constants.js index 54e400d9..4facc6e8 100644 --- a/lib/bcoin/protocol/constants.js +++ b/lib/bcoin/protocol/constants.js @@ -516,8 +516,7 @@ exports.hd = { HARDENED: 0x80000000, MAX_INDEX: 0x100000000, MIN_ENTROPY: 128 / 8, - MAX_ENTROPY: 512 / 8, - PATH_ROOTS: ['m', 'M', 'm\'', 'M\''] + MAX_ENTROPY: 512 / 8 }; /**