From 0dacc667a4cf81c6017d2972cbbc90f81424ef8b Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 4 Dec 2017 15:07:29 +0300 Subject: [PATCH] bip39 accounts, depth params --- routes/shepherd/electrum/keys.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/routes/shepherd/electrum/keys.js b/routes/shepherd/electrum/keys.js index 05178cf..ff49d89 100644 --- a/routes/shepherd/electrum/keys.js +++ b/routes/shepherd/electrum/keys.js @@ -98,14 +98,14 @@ module.exports = (shepherd) => { const seed = bip39.mnemonicToSeed(req.body.seed); const hdMaster = shepherd.bitcoinJS.HDNode.fromSeedBuffer(seed, shepherd.electrumJSNetworks.komodo); // seed from above const matchPattern = req.body.match; - const _defaultAddressDepth = 50; - const _defaultAccountCount = 20; + const _defaultAddressDepth = req.body.addressdepth; + const _defaultAccountCount = req.body.accounts; let _addresses = []; let _matchingKey; for (let i = 0; i < _defaultAccountCount; i++) { - for (let j = 0; j < 2; j++) { - for (let k = 0; k < 1; k++) { + for (let j = 0; j < 1; j++) { + for (let k = 0; k < _defaultAddressDepth; k++) { const _key = hdMaster.derivePath(`m/44'/141'/${i}'/${j}/${k}`); if (_key.keyPair.getAddress() === matchPattern) { @@ -132,7 +132,7 @@ module.exports = (shepherd) => { // spv v2 /*shepherd.get('/electrum/bip39/seed', (req, res, next) => { - const _seed = 'force mystery use shoot choice universe jaguar pattern aunt kiwi swarm tunnel wild pig cup cruise together neither else clean typical other farm recycle'; + const _seed = ''; // TODO const bip39 = require('bip39'); // npm i -S bip39 const crypto = require('crypto');