Skip to content

Commit

Permalink
StoredBlock: rework comment about usage of serializeCompact(), deseri…
Browse files Browse the repository at this point in the history
…alizeCompact()

The explicit list of usages was already stale. Rather, just mention
it's being used internally.
  • Loading branch information
schildbach committed Jun 27, 2024
1 parent a05fc05 commit 39f409f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/src/main/java/org/bitcoinj/core/StoredBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ public StoredBlock getPrev(BlockStore store) throws BlockStoreException {
return store.get(getHeader().getPrevBlockHash());
}

/** Serializes the stored block to a custom packed format. Used by {@link CheckpointManager}. */
/**
* Serializes the stored block to a custom packed format. Used internally.
*
* @param buffer buffer to write to
*/
public void serializeCompact(ByteBuffer buffer) {
byte[] chainWorkBytes = ByteUtils.bigIntegerToBytes(getChainWork(), CHAIN_WORK_BYTES);
if (chainWorkBytes.length < CHAIN_WORK_BYTES) {
Expand All @@ -138,8 +142,7 @@ public void serializeCompact(ByteBuffer buffer) {
}

/**
* Deserializes the stored block from a custom packed format. Used by {@link CheckpointManager} and
* {@link SPVBlockStore}.
* Deserializes the stored block from a custom packed format. Used internally.
*
* @param buffer data to deserialize
* @return deserialized stored block
Expand Down

0 comments on commit 39f409f

Please sign in to comment.