Browse Source

multisig address validation fix

custom-ac-example
pbca26 7 years ago
parent
commit
affeea86e6
  1. 4
      package.json
  2. 11
      routes/shepherd/electrum/keys.js

4
package.json

@ -1,7 +1,7 @@
{
"name": "agama-app",
"productName": "Agama",
"version": "0.2.30",
"version": "0.2.32",
"description": "Agama Wallet Desktop App",
"main": "main.js",
"scripts": {
@ -32,7 +32,7 @@
"async": "^2.6.0",
"bigi": "^1.4.2",
"bip39": "^2.4.0",
"bitcoinforksjs-lib": "git://github.com/bitcoinjs/bitcoinjs-lib#opt-in-bitcoincash-sighash",
"bitcoinforksjs-lib": "git://github.com/SuperNETorg/bitcoinjs-lib#opt-in-bitcoincash-sighash",
"bitcoinjs-lib": "git://github.com/SuperNETorg/bitcoinjs-lib",
"bitcoinjs-lib-zcash": "git://github.com/pbca26/bitcoinjs-lib#zcash",
"bitcoinjs-lib-pos": "git://github.com/KomodoPlatform/bitcoinjs-lib-pos",

11
routes/shepherd/electrum/keys.js

@ -155,7 +155,7 @@ module.exports = (shepherd) => {
const _b58check = shepherd.isZcash(network.toLowerCase()) ? bitcoinZcash.address.fromBase58Check(address) : bitcoin.address.fromBase58Check(address);
if (_b58check.version === _network.pubKeyHash ||
(address[0] === 'b' && shepherd.getNetworkData(network.toLowerCase()).pubKeyHash === 60)) { // kmd multisig edge case
_b58check.version === _network.scriptHash) {
return true;
} else {
return false;
@ -165,6 +165,15 @@ module.exports = (shepherd) => {
}
};
shepherd.get('/electrum/keys/validateaddress', (req, res, next) => {
const successObj = {
msg: 'success',
result: shepherd.addressVersionCheck(req.query.network, req.query.address),
};
res.end(JSON.stringify(successObj));
});
shepherd.post('/electrum/keys', (req, res, next) => {
if (shepherd.checkToken(req.body.token)) {
let _matchingKeyPairs = 0;

Loading…
Cancel
Save