coins format.

This commit is contained in:
Christopher Jeffrey 2016-07-05 12:11:36 -07:00
parent 28f6ebe43f
commit 6f345df018
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -213,7 +213,7 @@ Coins.prototype.toRaw = function toRaw(writer) {
bits += 0x100000000;
p.writeVarint(this.version);
p.writeVarint(bits);
p.writeU32(bits);
field = new Buffer(Math.ceil(length / 8));
field.fill(0);
@ -296,7 +296,7 @@ Coins.prototype.fromRaw = function fromRaw(data, hash, index) {
this.version = p.readVarint();
bits = p.readVarint();
bits = p.readU32();
this.height = bits >>> 1;
this.hash = hash;
@ -332,7 +332,7 @@ Coins.prototype.fromRaw = function fromRaw(data, hash, index) {
prefix = p.readU8();
// Skip past the compressed scripts.
switch (prefix & 3) {
switch (prefix) {
case 0:
p.seek(p.readVarint());
break;
@ -491,7 +491,7 @@ CompressedCoin.prototype.toCoin = function toCoin(coins, index) {
prefix = p.readU8();
// Decompress the script.
switch (prefix & 3) {
switch (prefix) {
case 0:
coin.script.fromRaw(p.readVarBytes());
break;