Skip to content

Commit

Permalink
encoding: minor.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Sep 5, 2017
1 parent 4046202 commit 83178e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/utils/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,13 @@ encoding.readVarintN = function readVarintN(data, off) {
const size = 9;
assert(off + size <= data.length, off);
const value = encoding.readU64N(data, off + 1);
enforce(value.gtn(0xffffffff), off, 'Non-canonical varint');
enforce(value.hi !== 0, off, 'Non-canonical varint');
return new Varint(size, value);
}

const result = encoding.readVarint(data, off);
result.value = U64.fromInt(result.value);
return result;
const {size, value} = encoding.readVarint(data, off);

return new Varint(size, U64.fromInt(value));
};

/**
Expand Down

0 comments on commit 83178e9

Please sign in to comment.