From 92522be8c2fe2de3618d864e3994ce04331f9891 Mon Sep 17 00:00:00 2001 From: Ben van Hartingsveldt Date: Sat, 5 Oct 2024 16:28:07 +0200 Subject: [PATCH] Fix database row --- src/main/java/com/lbry/database/rows/DBStatePrefixRow.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/lbry/database/rows/DBStatePrefixRow.java b/src/main/java/com/lbry/database/rows/DBStatePrefixRow.java index bcf1255..41ded47 100644 --- a/src/main/java/com/lbry/database/rows/DBStatePrefixRow.java +++ b/src/main/java/com/lbry/database/rows/DBStatePrefixRow.java @@ -1,7 +1,6 @@ package com.lbry.database.rows; import com.lbry.database.Prefix; -import com.lbry.database.PrefixDB; import com.lbry.database.keys.KeyInterface; import com.lbry.database.revert.RevertibleOperationStack; import com.lbry.database.values.DBState; @@ -55,7 +54,9 @@ public class DBStatePrefixRow extends PrefixRow{ @Override public DBState unpackValue(byte[] value){ - int height = ByteBuffer.wrap(value).position(32).order(ByteOrder.BIG_ENDIAN).getInt(); + ByteBuffer bbHeight = ByteBuffer.wrap(value).order(ByteOrder.BIG_ENDIAN); + bbHeight.position(32); + int height = bbHeight.getInt(); if(value.length==94){ value = ByteBuffer.allocate(value.length+4).order(ByteOrder.BIG_ENDIAN).put(value).putInt(height).array(); }