remove commented code. error consistency.
This commit is contained in:
parent
3dec18c2c7
commit
3f44538b46
@ -715,26 +715,16 @@ script.execute = function execute(s, stack, tx, index) {
|
|||||||
|
|
||||||
script.multisig = function(keys, m, n) {
|
script.multisig = function(keys, m, n) {
|
||||||
if (keys.length < m)
|
if (keys.length < m)
|
||||||
throw new Error('wrong amount of pubkeys for multisig script');
|
throw new Error('Wrong amount of pubkeys for multisig script');
|
||||||
|
|
||||||
assert(m >= 1 && m <= n);
|
assert(m >= 1 && m <= n);
|
||||||
assert(n >= 1 && n <= 15);
|
assert(n >= 1 && n <= 15);
|
||||||
|
|
||||||
// Format:
|
|
||||||
// op_[m] [pubkey1-len] [pubkey1] ... op_[n] op_checkmultisig
|
|
||||||
|
|
||||||
// Using pushdata ops for m and n:
|
|
||||||
// return [ [ m ] ].concat(
|
|
||||||
// keys,
|
|
||||||
// [ [ n ], 'checkmultisig' ]
|
|
||||||
// );
|
|
||||||
|
|
||||||
// Keys need to be in a predictable order.
|
// Keys need to be in a predictable order.
|
||||||
keys = keys.sort(function(a, b) {
|
keys = keys.sort(function(a, b) {
|
||||||
return new bn(a).cmp(new bn(b)) > 0;
|
return new bn(a).cmp(new bn(b)) > 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Using OP_1-16 for m and n:
|
|
||||||
return [ m ].concat(
|
return [ m ].concat(
|
||||||
keys,
|
keys,
|
||||||
[ n, 'checkmultisig' ]
|
[ n, 'checkmultisig' ]
|
||||||
|
|||||||
@ -190,7 +190,7 @@ TX.prototype.scriptInput = function(input, pub) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error('scriptInput(): could not identify prev_out type');
|
throw new Error('scriptInput(): Could not identify prev_out type');
|
||||||
};
|
};
|
||||||
|
|
||||||
// Sign the now-built scriptSigs
|
// Sign the now-built scriptSigs
|
||||||
@ -283,7 +283,7 @@ TX.prototype.signInput = function(input, key, type) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error('signInput(): could not identify prev_out type');
|
throw new Error('signInput(): Could not identify prev_out type');
|
||||||
};
|
};
|
||||||
|
|
||||||
// Build the scriptSig and sign it
|
// Build the scriptSig and sign it
|
||||||
|
|||||||
@ -158,7 +158,7 @@ Wallet.prototype.derive = function derive() {
|
|||||||
var options = this.options;
|
var options = this.options;
|
||||||
|
|
||||||
if (!this.hd)
|
if (!this.hd)
|
||||||
throw new Error('wallet is not HD');
|
throw new Error('Wallet is not HD');
|
||||||
|
|
||||||
options.priv = this.hd.derive.apply(this.hd, arguments);
|
options.priv = this.hd.derive.apply(this.hd, arguments);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user