minor cleanup of wallet.sign
This commit is contained in:
parent
0ce14a7c84
commit
a1c80b8f51
1 changed files with 4 additions and 5 deletions
|
@ -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…
Add table
Reference in a new issue