Browse Source

fix .fromScriptPubKey parsing in some strange Txs

patch-2
Matias Alejo Garcia 11 years ago
parent
commit
691fec5342
  1. 142
      browser/bundle.js
  2. 6
      lib/Address.js

142
browser/bundle.js

File diff suppressed because one or more lines are too long

6
lib/Address.js

@ -119,14 +119,16 @@ Address.fromScriptPubKey = function(scriptPubKey, network) {
case Script.TX_MULTISIG: case Script.TX_MULTISIG:
version = networks[network].addressVersion; version = networks[network].addressVersion;
for(var i in payload) for(var i in payload)
payload[i] = coinUtil.sha256ripe160(payload[i]); if(payload[i])
payload[i] = coinUtil.sha256ripe160(payload[i]);
break; break;
case Script.TX_SCRIPTHASH: case Script.TX_SCRIPTHASH:
version = networks[network].P2SHVersion; version = networks[network].P2SHVersion;
break; break;
} }
for(var i in payload) for(var i in payload)
ret.push(new Address(version,payload[i])); if(payload[i])
ret.push(new Address(version,payload[i]));
} }
return ret; return ret;
}; };

Loading…
Cancel
Save