forked from Qortal/qortal
Fixed bug in expected chunk count.
This commit is contained in:
parent
e46c735efa
commit
4b1de108d1
@ -100,7 +100,7 @@ public class ArbitraryTransaction extends Transaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check expected length of chunk hashes
|
// Check expected length of chunk hashes
|
||||||
int chunkCount = arbitraryTransactionData.getSize() / DataFileChunk.CHUNK_SIZE;
|
int chunkCount = (int)Math.ceil((double)arbitraryTransactionData.getSize() / (double)DataFileChunk.CHUNK_SIZE);
|
||||||
int expectedChunkHashesSize = (chunkCount > 1) ? chunkCount * HASH_LENGTH : 0;
|
int expectedChunkHashesSize = (chunkCount > 1) ? chunkCount * HASH_LENGTH : 0;
|
||||||
if (chunkHashes == null && expectedChunkHashesSize > 0) {
|
if (chunkHashes == null && expectedChunkHashesSize > 0) {
|
||||||
return ValidationResult.INVALID_DATA_LENGTH;
|
return ValidationResult.INVALID_DATA_LENGTH;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user