fix: wallet.sign return value.

This commit is contained in:
Christopher Jeffrey 2014-06-06 14:54:02 -05:00
parent ac60920f98
commit ac8905bf3d

View File

@ -219,10 +219,10 @@ Wallet.prototype.sign = function sign(tx, type, inputs, off) {
inputs = inputs || tx.inputs;
// Add signature script to each input
inputs.forEach(function(input, i) {
inputs = inputs.filter(function(input, i) {
// Filter inputs that this wallet own
if (!input.out.tx || !this.ownOutput(input.out.tx))
return;
return false;
var s = input.out.tx.getSubscript(input.out.index);
var hash = tx.subscriptHash(off + i, s, type);
@ -231,11 +231,13 @@ Wallet.prototype.sign = function sign(tx, type, inputs, off) {
if (bcoin.script.isPubkeyhash(s)) {
input.script = [ signature, pub ];
return;
return true;
}
// Multisig
input.script = [ [], signature ];
return true;
}, this);
return inputs.length;