Browse Source

Merge pull request #212 from SuperNETorg/electrum

hide wif prints; auth get -> post
pkg_automation_electrum
pbca26 7 years ago
committed by GitHub
parent
commit
6cb85d5e8e
  1. 6
      routes/shepherd/electrum/auth.js
  2. 6
      routes/shepherd/electrum/keys.js

6
routes/shepherd/electrum/auth.js

@ -1,8 +1,8 @@
module.exports = (shepherd) => { module.exports = (shepherd) => {
shepherd.get('/electrum/login', (req, res, next) => { shepherd.post('/electrum/login', (req, res, next) => {
for (let key in shepherd.electrumServers) { for (let key in shepherd.electrumServers) {
const _abbr = shepherd.electrumServers[key].abbr; const _abbr = shepherd.electrumServers[key].abbr;
const { priv, pub } = shepherd.seedToWif(req.query.seed, shepherd.findNetworkObj(_abbr), req.query.iguana); const { priv, pub } = shepherd.seedToWif(req.body.seed, shepherd.findNetworkObj(_abbr), req.body.iguana);
shepherd.electrumKeys[_abbr] = { shepherd.electrumKeys[_abbr] = {
priv, priv,
@ -12,7 +12,7 @@ module.exports = (shepherd) => {
shepherd.electrumCoins.auth = true; shepherd.electrumCoins.auth = true;
shepherd.log(JSON.stringify(shepherd.electrumKeys, null, '\t'), true); // shepherd.log(JSON.stringify(shepherd.electrumKeys, null, '\t'), true);
const successObj = { const successObj = {
msg: 'success', msg: 'success',

6
routes/shepherd/electrum/keys.js

@ -23,8 +23,8 @@ module.exports = (shepherd) => {
key.compressed = true; key.compressed = true;
shepherd.log(`seedtowif priv key ${key.privateWif}`, true); // shepherd.log(`seedtowif priv key ${key.privateWif}`, true);
shepherd.log(`seedtowif pub key ${key.publicAddress}`, true); // shepherd.log(`seedtowif pub key ${key.publicAddress}`, true);
return { return {
priv: key.privateWif, priv: key.privateWif,
@ -71,7 +71,7 @@ module.exports = (shepherd) => {
_electrumKeys = shepherd.electrumKeys; _electrumKeys = shepherd.electrumKeys;
} }
shepherd.log(JSON.stringify(_electrumKeys, null, '\t'), true); // shepherd.log(JSON.stringify(_electrumKeys, null, '\t'), true);
const successObj = { const successObj = {
msg: 'success', msg: 'success',

Loading…
Cancel
Save