Skip to content

Commit

Permalink
fix empty apphash
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Jun 28, 2024
1 parent b8bbcbd commit 5a36506
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/header/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ func (i *Info) Bytes() ([]byte, error) {
binary.LittleEndian.PutUint64(timeBytes, uint64(i.Time.Unix()))
buf = append(buf, timeBytes...)

if len(i.AppHash) == 0 {
i.AppHash = make([]byte, hashSize)
}
// if len(i.AppHash) == 0 {
// i.AppHash = make([]byte, hashSize)
// }
// Encode AppHash
if len(i.Hash) != hashSize {
return nil, errors.New("invalid hash size")
Expand Down
4 changes: 2 additions & 2 deletions server/v2/cometbft/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ func (c *Consensus[T]) InitChain(ctx context.Context, req *abciproto.InitChainRe
br := &coreappmgr.BlockRequest[T]{
Height: uint64(req.InitialHeight - 1),
Time: req.Time,
Hash: ci.Hash,
AppHash: nil,
Hash: nil,
AppHash: ci.Hash,
ChainId: req.ChainId,
ConsensusMessages: consMessages,
IsGenesis: true,
Expand Down

0 comments on commit 5a36506

Please sign in to comment.