Browse Source

spv uncompressed wif

v0.25
pbca26 7 years ago
parent
commit
6855aefb9f
  1. 11
      routes/shepherd/electrum/auth.js

11
routes/shepherd/electrum/auth.js

@ -2,18 +2,19 @@ module.exports = (shepherd) => {
shepherd.post('/electrum/login', (req, res, next) => {
for (let key in shepherd.electrumServers) {
const _abbr = shepherd.electrumServers[key].abbr;
const _seed = req.body.seed;
let keys;
if (req.body.seed.length === 52 &&
req.body.seed.indexOf(' ') === -1 &&
req.body.seed.match(/^[a-zA-Z0-9]*$/)) {
let key = shepherd.bitcoinJS.ECPair.fromWIF(req.body.seed, shepherd.electrumJSNetworks.komodo);
if ((_seed.length === 51 || _seed.length === 52) &&
_seed.indexOf(' ') === -1 &&
_seed.match(/^[a-zA-Z0-9]*$/)) {
let key = shepherd.bitcoinJS.ECPair.fromWIF(_seed, shepherd.electrumJSNetworks.komodo);
keys = {
priv: key.toWIF(),
pub: key.getAddress(),
};
} else {
keys = shepherd.seedToWif(req.body.seed, shepherd.findNetworkObj(_abbr), req.body.iguana, req.body.old);
keys = shepherd.seedToWif(_seed, shepherd.findNetworkObj(_abbr), req.body.iguana);
}
shepherd.electrumKeys[_abbr] = {

Loading…
Cancel
Save