mirror of
https://github.com/status-im/ethereumj-personal.git
synced 2025-01-13 13:24:40 +00:00
Fix for encodeLength() fix
This commit is contained in:
parent
02bce31d63
commit
662f341ad3
@ -745,10 +745,10 @@ public class RLP {
|
|||||||
return new byte[] { firstByte };
|
return new byte[] { firstByte };
|
||||||
} else if (length < MAX_ITEM_LENGTH) {
|
} else if (length < MAX_ITEM_LENGTH) {
|
||||||
byte[] binaryLength;
|
byte[] binaryLength;
|
||||||
if(length < 0xFF)
|
if(length > 0xFF)
|
||||||
binaryLength = new byte[] { (byte) length };
|
|
||||||
else
|
|
||||||
binaryLength = BigInteger.valueOf(length).toByteArray();
|
binaryLength = BigInteger.valueOf(length).toByteArray();
|
||||||
|
else
|
||||||
|
binaryLength = new byte[] { (byte) length };
|
||||||
byte firstByte = (byte) (binaryLength.length + offset + SIZE_THRESHOLD - 1 );
|
byte firstByte = (byte) (binaryLength.length + offset + SIZE_THRESHOLD - 1 );
|
||||||
return concatenate(new byte[] { firstByte }, binaryLength);
|
return concatenate(new byte[] { firstByte }, binaryLength);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user