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;
|
||||
|
||||
// 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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user