From 05feea62c09e366ab4840aedb95f8f5ebdc7b6e6 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 23 Oct 2017 12:18:35 +0300 Subject: [PATCH 1/2] cliStopTimeout settings option --- main.js | 4 ++-- routes/appConfig.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index eec8abd..cf9aaa3 100644 --- a/main.js +++ b/main.js @@ -429,7 +429,7 @@ function createWindow(status) { shepherd.log('Closing Main Window...'); shepherd.writeLog('exiting app...'); - shepherd.quitKomodod(1000); + shepherd.quitKomodod(appConfig.cliStopTimeout); const result = 'Closing daemons: done'; @@ -480,7 +480,7 @@ function createWindow(status) { closeApp(); } else { createAppCloseWindow(); - shepherd.quitKomodod(1000); + shepherd.quitKomodod(appConfig.cliStopTimeout); _appClosingInterval = setInterval(function() { if (!Object.keys(shepherd.coindInstanceRegistry).length) { closeApp(); diff --git a/routes/appConfig.js b/routes/appConfig.js index 93d5549..a6420fe 100644 --- a/routes/appConfig.js +++ b/routes/appConfig.js @@ -14,6 +14,7 @@ const appConfig = { dex: { walletUnlockTimeout: 3600, }, + cliStopTimeout: 1000, }, schema: { host: { @@ -91,6 +92,11 @@ const appConfig = { type: 'number', }, }, + cliStopTimeout: { + display: true, + displayName: 'CLI stop timeout', + type: 'number', + }, }, }; From 48a5fd59e2efccb2447ba5eb97624462e15e29fd Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 5 Nov 2017 12:15:22 +0300 Subject: [PATCH 2/2] wif login --- routes/shepherd/dashboardUpdate.js | 1 + routes/shepherd/electrum/auth.js | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/routes/shepherd/dashboardUpdate.js b/routes/shepherd/dashboardUpdate.js index bc0e521..d8db845 100644 --- a/routes/shepherd/dashboardUpdate.js +++ b/routes/shepherd/dashboardUpdate.js @@ -261,6 +261,7 @@ module.exports = (shepherd) => { shepherd.Promise.all(_promiseStack.map((_call, index) => { let _params; + if (_call === 'listtransactions') { _params = [ '', diff --git a/routes/shepherd/electrum/auth.js b/routes/shepherd/electrum/auth.js index e4b689c..3026f2b 100644 --- a/routes/shepherd/electrum/auth.js +++ b/routes/shepherd/electrum/auth.js @@ -2,11 +2,23 @@ module.exports = (shepherd) => { shepherd.post('/electrum/login', (req, res, next) => { for (let key in shepherd.electrumServers) { const _abbr = shepherd.electrumServers[key].abbr; - const { priv, pub } = shepherd.seedToWif(req.body.seed, shepherd.findNetworkObj(_abbr), req.body.iguana); + let keys; + + if (req.body.seed.length === 52 && + req.body.seed[0] === 'U' && + req.body.seed.match(/^[a-zA-Z0-9]*$/)) { + let key = shepherd.bitcoinJS.ECPair.fromWIF(req.body.seed, shepherd.electrumJSNetworks.komodo); + keys = { + priv: key.toWIF(), + pub: key.getAddress(), + }; + } else { + keys = shepherd.seedToWif(req.body.seed, shepherd.findNetworkObj(_abbr), req.body.iguana); + } shepherd.electrumKeys[_abbr] = { - priv, - pub, + priv: keys.priv, + pub: keys.pub, }; }