Browse Source

Merge pull request #217 from SuperNETorg/electrum

Electrum
pkg_automation_electrum
pbca26 7 years ago
committed by GitHub
parent
commit
a7ed4348b3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      main.js
  2. 6
      routes/appConfig.js
  3. 1
      routes/shepherd/dashboardUpdate.js
  4. 18
      routes/shepherd/electrum/auth.js

4
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();

6
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',
},
},
};

1
routes/shepherd/dashboardUpdate.js

@ -261,6 +261,7 @@ module.exports = (shepherd) => {
shepherd.Promise.all(_promiseStack.map((_call, index) => {
let _params;
if (_call === 'listtransactions') {
_params = [
'',

18
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,
};
}

Loading…
Cancel
Save