mirror of
https://github.com/LBRYFoundation/lbry-database-java.git
synced 2025-08-23 09:27:22 +00:00
Fix database row
This commit is contained in:
parent
1bfdc90ec1
commit
92522be8c2
1 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
package com.lbry.database.rows;
|
package com.lbry.database.rows;
|
||||||
|
|
||||||
import com.lbry.database.Prefix;
|
import com.lbry.database.Prefix;
|
||||||
import com.lbry.database.PrefixDB;
|
|
||||||
import com.lbry.database.keys.KeyInterface;
|
import com.lbry.database.keys.KeyInterface;
|
||||||
import com.lbry.database.revert.RevertibleOperationStack;
|
import com.lbry.database.revert.RevertibleOperationStack;
|
||||||
import com.lbry.database.values.DBState;
|
import com.lbry.database.values.DBState;
|
||||||
|
@ -55,7 +54,9 @@ public class DBStatePrefixRow extends PrefixRow<KeyInterface,DBState>{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DBState unpackValue(byte[] value){
|
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){
|
if(value.length==94){
|
||||||
value = ByteBuffer.allocate(value.length+4).order(ByteOrder.BIG_ENDIAN).put(value).putInt(height).array();
|
value = ByteBuffer.allocate(value.length+4).order(ByteOrder.BIG_ENDIAN).put(value).putInt(height).array();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue