bip152: always use witness serialization.

This commit is contained in:
Christopher Jeffrey 2016-07-20 14:51:44 -07:00
parent b939de9423
commit a85f3edde5
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -126,7 +126,7 @@ CompactBlock.fromRaw = function fromRaw(data, enc) {
return new CompactBlock().fromRaw(data);
};
CompactBlock.prototype.toRaw = function toRaw(witness, writer) {
CompactBlock.prototype.toRaw = function toRaw(writer) {
var p = bcoin.writer(writer);
var i, id, lo, hi, ptx;
@ -155,10 +155,7 @@ CompactBlock.prototype.toRaw = function toRaw(witness, writer) {
for (i = 0; i < this.ptx.length; i++) {
ptx = this.ptx[i];
p.writeVarint2(ptx[0]);
if (!witness)
ptx[1].toNormal(p);
else
ptx[1].toRaw(p);
ptx[1].toRaw(p);
}
if (!writer)