Skip to content

Commit 319a924

Browse files
authored
fix(ledger): update new tip log message for genesis (#782)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 889c9ef commit 319a924

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ledger/state.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,16 @@ func (ls *LedgerState) ledgerProcessBlocks() {
608608
}
609609
}
610610
if len(nextBatch) > 0 {
611+
var hash string
612+
if ls.currentTip.Point.Slot == 0 {
613+
hash = "<genesis>"
614+
} else {
615+
hash = hex.EncodeToString(ls.currentTip.Point.Hash)
616+
}
611617
ls.config.Logger.Info(
612618
fmt.Sprintf(
613-
"chain extended, new tip: %x at slot %d",
614-
ls.currentTip.Point.Hash,
619+
"chain extended, new tip: %s at slot %d",
620+
hash,
615621
ls.currentTip.Point.Slot,
616622
),
617623
"component",

0 commit comments

Comments
 (0)