BlockFileLoader: Remove inexact block size check.

Bitcoin Core doesn't allow over- or undersized blocks in its dat files.
This commit is contained in:
Andreas Schildbach 2021-08-10 21:52:33 +02:00
parent e407240b7e
commit a61080ebeb

View file

@ -157,9 +157,6 @@ public class BlockFileLoader implements Iterable<Block>, Iterator<Block> {
byte[] bytes = new byte[4];
currentFileStream.read(bytes, 0, 4);
long size = Utils.readUint32BE(Utils.reverseBytes(bytes), 0);
// We allow larger than MAX_BLOCK_SIZE because test code uses this as well.
if (size > Block.MAX_BLOCK_SIZE*2 || size <= 0)
continue;
bytes = new byte[(int) size];
currentFileStream.read(bytes, 0, (int) size);
try {