Skip to content

Commit

Permalink
BlockFileLoader: Remove inexact block size check.
Browse files Browse the repository at this point in the history
Bitcoin Core doesn't allow over- or undersized blocks in its dat files.
  • Loading branch information
Andreas Schildbach authored and ripcurlx committed Aug 23, 2021
1 parent 60dc0dc commit 4737ff4
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions core/src/main/java/org/bitcoinj/utils/BlockFileLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ private void loadNextBlock() {
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 {
Expand Down

0 comments on commit 4737ff4

Please sign in to comment.