Skip to content

Commit d70b8cd

Browse files
committed
proof: reset cached raw proof and size.
1 parent 7a14b97 commit d70b8cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/proof.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ class WrappedProof {
5858
*/
5959

6060
read(data, off) {
61-
this._proof.read(data, off, BLAKE2b, HASH_BITS);
61+
const pos = this._proof.read(data, off, BLAKE2b, HASH_BITS);
62+
this._raw = data.slice(off, pos);
63+
this._size = pos - off;
6264
return this;
6365
}
6466

@@ -68,6 +70,8 @@ class WrappedProof {
6870
*/
6971

7072
readBR(br) {
73+
this._raw = null;
74+
this._size = null;
7175
this._proof.readBR(br, BLAKE2b, HASH_BITS);
7276
return this;
7377
}
@@ -89,7 +93,6 @@ class WrappedProof {
8993
*/
9094

9195
decode(data) {
92-
this._raw = data;
9396
this.read(data, 0);
9497
return this;
9598
}

0 commit comments

Comments
 (0)