Skip to content

Commit

Permalink
StoredBlock: update comment about CHAIN_WORK_BYTES
Browse files Browse the repository at this point in the history
The original comment, written in 2011 said "12 bytes should be plenty for now".
As of June 2024, we know that 12 bytes is not enough.
  • Loading branch information
msgilligan authored and schildbach committed Jun 24, 2024
1 parent 0aa17cd commit 32e9145
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/core/StoredBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
*/
public class StoredBlock {

// A BigInteger representing the total amount of work done so far on this chain. As of May 2011 it takes 8
// bytes to represent this field, so 12 bytes should be plenty for now.
// A BigInteger representing the total amount of work done so far on this chain. As of June 22, 2024, it takes 12
// unsigned bytes to store this value, so we need to create an updated storage format soon.
private static final int CHAIN_WORK_BYTES = 12;
private static final byte[] EMPTY_BYTES = new byte[CHAIN_WORK_BYTES];
public static final int COMPACT_SERIALIZED_SIZE = Block.HEADER_SIZE + CHAIN_WORK_BYTES + 4; // for height
Expand Down

0 comments on commit 32e9145

Please sign in to comment.