Skip to content

Commit

Permalink
core: check journalType before load journal
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjunLi committed Apr 18, 2024
1 parent 9e0c626 commit 8233676
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions triedb/pathdb/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ func (dl *diskLayer) journal(w io.Writer, journalType JournalType) error {
}

// Store the journal buf into w and calculate checksum
if journalType == JournalKVType {
if journalType == JournalFileType {
shasum := sha256.Sum256(journalBuf.Bytes())
if err := rlp.Encode(w, journalBuf.Bytes()); err != nil {
return err
Expand Down Expand Up @@ -537,7 +537,7 @@ func (dl *diffLayer) journal(w io.Writer, journalType JournalType) error {
}

// Store the journal buf into w and calculate checksum
if journalType == JournalKVType {
if journalType == JournalFileType {
shasum := sha256.Sum256(journalBuf.Bytes())
if err := rlp.Encode(w, journalBuf.Bytes()); err != nil {
return err
Expand Down

0 comments on commit 8233676

Please sign in to comment.