Fix for encodeLength() fix

This commit is contained in:
nicksavers 2014-05-15 14:12:58 +02:00
parent 02bce31d63
commit 662f341ad3
1 changed files with 3 additions and 3 deletions

View File

@ -745,10 +745,10 @@ public class RLP {
return new byte[] { firstByte };
} else if (length < MAX_ITEM_LENGTH) {
byte[] binaryLength;
if(length < 0xFF)
binaryLength = new byte[] { (byte) length };
else
if(length > 0xFF)
binaryLength = BigInteger.valueOf(length).toByteArray();
else
binaryLength = new byte[] { (byte) length };
byte firstByte = (byte) (binaryLength.length + offset + SIZE_THRESHOLD - 1 );
return concatenate(new byte[] { firstByte }, binaryLength);
} else {