implement Script.buildMultisigOut()
This commit is contained in:
parent
7b54a53414
commit
163925c754
@ -429,9 +429,15 @@ Script.prototype._addBuffer = function(buf, prepend) {
|
||||
* requiring m of those public keys to spend
|
||||
*/
|
||||
Script.buildMultisigOut = function(pubkeys, m) {
|
||||
console.log(pubkeys);
|
||||
console.log(m);
|
||||
return new Script();
|
||||
var s = new Script();
|
||||
s.add(Opcode.smallInt(m));
|
||||
for (var i = 0; i<pubkeys.length; i++) {
|
||||
var pubkey = pubkeys[i];
|
||||
s.add(pubkey.toBuffer());
|
||||
}
|
||||
s.add(Opcode.smallInt(pubkeys.length));
|
||||
s.add(Opcode('OP_CHECKMULTISIG'));
|
||||
return s;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user