mirror of
https://github.com/ok2/coinbin.git
synced 2026-05-09 18:15:23 +02:00
fixed multisig bug as described in issues/212
This commit is contained in:
+8
-1
@@ -1336,7 +1336,14 @@
|
||||
return {'type':'segwit', 'signed':signed, 'signatures': sigs, 'script': Crypto.util.bytesToHex(this.ins[index].script.chunks[0]), 'value': value};
|
||||
} else if (this.ins[index].script.chunks[0]==0 && this.ins[index].script.chunks[this.ins[index].script.chunks.length-1][this.ins[index].script.chunks[this.ins[index].script.chunks.length-1].length-1]==174) { // OP_CHECKMULTISIG
|
||||
// multisig script, with signature(s) included
|
||||
return {'type':'multisig', 'signed':'true', 'signatures':this.ins[index].script.chunks.length-2, 'script': Crypto.util.bytesToHex(this.ins[index].script.chunks[this.ins[index].script.chunks.length-1])};
|
||||
sigcount = 0;
|
||||
for(i=1; i<this.ins[index].script.chunks.length-1;i++){
|
||||
if(this.ins[index].script.chunks[i]!=0){
|
||||
sigcount++;
|
||||
}
|
||||
}
|
||||
|
||||
return {'type':'multisig', 'signed':'true', 'signatures':sigcount, 'script': Crypto.util.bytesToHex(this.ins[index].script.chunks[this.ins[index].script.chunks.length-1])};
|
||||
} else if (this.ins[index].script.chunks[0]>=80 && this.ins[index].script.chunks[this.ins[index].script.chunks.length-1]==174) { // OP_CHECKMULTISIG
|
||||
// multisig script, without signature!
|
||||
return {'type':'multisig', 'signed':'false', 'signatures':0, 'script': Crypto.util.bytesToHex(this.ins[index].script.buffer)};
|
||||
|
||||
Reference in New Issue
Block a user