Skip to content

Commit 324a7aa

Browse files
authored
Merge pull request #231 from blinklabs-io/fix/byron-block-hash
fix: use correct prefix values for Byron block hash
2 parents 3d57417 + b4fba20 commit 324a7aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ledger/byron.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (h *ByronMainBlockHeader) Hash() string {
6666
// Prepend bytes for CBOR list wrapper
6767
// The block hash is calculated with these extra bytes, so we have to add them to
6868
// get the correct value
69-
h.hash = generateBlockHeaderHash(h.Cbor(), []byte{0x82, BLOCK_TYPE_BYRON_EBB})
69+
h.hash = generateBlockHeaderHash(h.Cbor(), []byte{0x82, BLOCK_TYPE_BYRON_MAIN})
7070
}
7171
return h.hash
7272
}
@@ -125,7 +125,7 @@ func (h *ByronEpochBoundaryBlockHeader) Hash() string {
125125
// Prepend bytes for CBOR list wrapper
126126
// The block hash is calculated with these extra bytes, so we have to add them to
127127
// get the correct value
128-
h.hash = generateBlockHeaderHash(h.Cbor(), []byte{0x82, BLOCK_TYPE_BYRON_MAIN})
128+
h.hash = generateBlockHeaderHash(h.Cbor(), []byte{0x82, BLOCK_TYPE_BYRON_EBB})
129129
}
130130
return h.hash
131131
}

0 commit comments

Comments
 (0)