3
0
mirror of https://github.com/Qortal/AT.git synced 2025-01-30 19:02:14 +00:00

Fix wrong operator when calculating creationBytesLength

This commit is contained in:
catbref 2019-11-21 17:28:49 +00:00
parent 00fd8b040d
commit 436a65c281

View File

@ -451,7 +451,7 @@ public class MachineState {
throw new IllegalArgumentException("Empty data bytes"); throw new IllegalArgumentException("Empty data bytes");
short numDataPages = (short) (((dataBytes.length - 1) / constants.DATA_PAGE_SIZE) + 1); short numDataPages = (short) (((dataBytes.length - 1) / constants.DATA_PAGE_SIZE) + 1);
int creationBytesLength = HEADER_LENGTH + numCodePages * constants.CODE_PAGE_SIZE + numDataPages + constants.DATA_PAGE_SIZE; int creationBytesLength = HEADER_LENGTH + numCodePages * constants.CODE_PAGE_SIZE + numDataPages * constants.DATA_PAGE_SIZE;
byte[] creationBytes = new byte[creationBytesLength]; byte[] creationBytes = new byte[creationBytesLength];
ByteBuffer byteBuffer = ByteBuffer.wrap(creationBytes); ByteBuffer byteBuffer = ByteBuffer.wrap(creationBytes);