diff --git a/core/src/main/java/org/bitcoinj/store/SPVBlockStore.java b/core/src/main/java/org/bitcoinj/store/SPVBlockStore.java index e177c39b2da..f94c82b7215 100644 --- a/core/src/main/java/org/bitcoinj/store/SPVBlockStore.java +++ b/core/src/main/java/org/bitcoinj/store/SPVBlockStore.java @@ -371,28 +371,16 @@ public void close() throws BlockStoreException { } static final int RECORD_SIZE_V1 = 32 /* hash */ + StoredBlock.COMPACT_SERIALIZED_SIZE; - - // V1 file format: - // 4 magic header bytes = "SPVB" - // 4 cursor bytes, which indicate the offset from the first kb where the next block header should be written. - // 32 bytes for the hash of the chain head - // - // For each header (128 bytes) - // 32 bytes hash of the header - // 12 bytes of chain work - // 4 bytes of height - // 80 bytes of block header data - static final int RECORD_SIZE_V2 = 32 /* hash */ + StoredBlock.COMPACT_SERIALIZED_SIZE_V2; - // V2 file format: - // 4 magic header bytes = "SPV2" + // V2 file format, V1 in parenthesis: + // 4 magic header bytes = "SPV2" ("SPVB" for V1) // 4 cursor bytes, which indicate the offset from the first kb where the next block header should be written. // 32 bytes for the hash of the chain head // - // For each header (148 bytes) + // For each header: // 32 bytes hash of the header - // 32 bytes of chain work + // 32 bytes of chain work (12 bytes for V1) // 4 bytes of height // 80 bytes of block header data