Skip to content

Commit

Permalink
feat(node/services): use genesis if trusted hash is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Jan 13, 2022
1 parent b7a88e8 commit 65d0e61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions node/services/config.go
Expand Up @@ -3,6 +3,7 @@ package services
import (
"encoding/hex"

"github.com/celestiaorg/celestia-node/build"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/multiformats/go-multiaddr"
tmbytes "github.com/tendermint/tendermint/libs/bytes"
Expand Down Expand Up @@ -40,5 +41,8 @@ func (cfg *Config) trustedPeer() (*peer.AddrInfo, error) {
}

func (cfg *Config) trustedHash() (tmbytes.HexBytes, error) {
if cfg.TrustedHash == "" {
return hex.DecodeString(build.Genesis())
}
return hex.DecodeString(cfg.TrustedHash)
}

0 comments on commit 65d0e61

Please sign in to comment.