Fixing bug in RLP

This commit is contained in:
romanman 2014-05-28 19:34:05 +03:00
parent a175dc699f
commit 71e185d9eb
1 changed files with 2 additions and 2 deletions

View File

@ -813,7 +813,7 @@ public class RLP {
}
byte[] lenBytes = new byte[byteNum];
for (int i = 0; i < byteNum; ++i) {
lenBytes[0] = (byte) ((srcData.length >> (8 * i)) & 0xFF);
lenBytes[byteNum - 1 - i] = (byte) ((srcData.length >> (8 * i)) & 0xFF);
}
// first byte = F7 + bytes.length
byte[] data = Arrays.copyOf(srcData, srcData.length + 1 + byteNum);
@ -851,7 +851,7 @@ public class RLP {
tmpLength = totalLength;
byte[] lenBytes = new byte[byteNum];
for (int i = 0; i < byteNum; ++i) {
lenBytes[i] = (byte) ((tmpLength >> (8 * i)) & 0xFF);
lenBytes[byteNum - 1 - i] = (byte) ((tmpLength >> (8 * i)) & 0xFF);
}
// first byte = F7 + bytes.length
data = new byte[1 + lenBytes.length + totalLength];