fix: wallet.sign return value.
This commit is contained in:
parent
ac60920f98
commit
ac8905bf3d
@ -219,10 +219,10 @@ Wallet.prototype.sign = function sign(tx, type, inputs, off) {
|
|||||||
inputs = inputs || tx.inputs;
|
inputs = inputs || tx.inputs;
|
||||||
|
|
||||||
// Add signature script to each input
|
// Add signature script to each input
|
||||||
inputs.forEach(function(input, i) {
|
inputs = inputs.filter(function(input, i) {
|
||||||
// Filter inputs that this wallet own
|
// Filter inputs that this wallet own
|
||||||
if (!input.out.tx || !this.ownOutput(input.out.tx))
|
if (!input.out.tx || !this.ownOutput(input.out.tx))
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
var s = input.out.tx.getSubscript(input.out.index);
|
var s = input.out.tx.getSubscript(input.out.index);
|
||||||
var hash = tx.subscriptHash(off + i, s, type);
|
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)) {
|
if (bcoin.script.isPubkeyhash(s)) {
|
||||||
input.script = [ signature, pub ];
|
input.script = [ signature, pub ];
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multisig
|
// Multisig
|
||||||
input.script = [ [], signature ];
|
input.script = [ [], signature ];
|
||||||
|
|
||||||
|
return true;
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
return inputs.length;
|
return inputs.length;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user