Browse Source

minor cleanup of wallet.sign

hk-custom-address
Wei Lu 11 years ago
parent
commit
a1c80b8f51
  1. 9
      src/wallet.js

9
src/wallet.js

@ -262,11 +262,10 @@ var Wallet = function (seed, options) {
} }
this.sign = function(tx) { this.sign = function(tx) {
tx.ins.map(function(inp,i) { tx.ins.forEach(function(inp,i) {
var inp = inp.outpoint.hash+':'+inp.outpoint.index; var output = me.outputs[inp.outpoint.hash+':'+inp.outpoint.index]
if (me.outputs[inp]) { if (output) {
var address = me.outputs[inp].address tx.sign(i, me.getPrivateKeyForAddress(output.address))
tx.sign(i, me.getPrivateKeyForAddress(address))
} }
}) })
return tx; return tx;

Loading…
Cancel
Save