Now uses varIntToNum
This commit is contained in:
parent
f12f8eac48
commit
63dd7c7dec
1 changed files with 5 additions and 5 deletions
|
@ -254,11 +254,11 @@ Transaction.deserialize = function(buffer) {
|
||||||
return buffer[pos-1] + readAsInt(bytes-1) * 256;
|
return buffer[pos-1] + readAsInt(bytes-1) * 256;
|
||||||
}
|
}
|
||||||
var readVarInt = function() {
|
var readVarInt = function() {
|
||||||
pos++;
|
var bytes = buffer.slice(pos, pos + 9) // maximum possible number of bytes to read
|
||||||
if (buffer[pos-1] < 253) {
|
var result = convert.varIntToNum(bytes)
|
||||||
return buffer[pos-1];
|
|
||||||
}
|
pos += result.bytes.length
|
||||||
return readAsInt(buffer[pos-1] - 251);
|
return result.number
|
||||||
}
|
}
|
||||||
var readBytes = function(bytes) {
|
var readBytes = function(bytes) {
|
||||||
pos += bytes;
|
pos += bytes;
|
||||||
|
|
Loading…
Add table
Reference in a new issue