diff --git a/triedb/pathdb/database_test.go b/triedb/pathdb/database_test.go index 2e7e1bef05..4a000256c7 100644 --- a/triedb/pathdb/database_test.go +++ b/triedb/pathdb/database_test.go @@ -543,7 +543,7 @@ func TestCorruptedJournal(t *testing.T) { // Mutate the journal in disk, it should be regarded as invalid blob := rawdb.ReadTrieJournal(tester.db.diskdb) - blob[0] = 0xa + blob[0] = 0x1 rawdb.WriteTrieJournal(tester.db.diskdb, blob) // Verify states, all not-yet-written states should be discarded diff --git a/triedb/pathdb/journal.go b/triedb/pathdb/journal.go index 3a0b7ebae2..d0fee08612 100644 --- a/triedb/pathdb/journal.go +++ b/triedb/pathdb/journal.go @@ -46,8 +46,7 @@ var ( // Changelog: // // - Version 0: initial version -// - Version 1: storage.Incomplete field is removed -const journalVersion uint64 = 1 +const journalVersion uint64 = 0 // journalNode represents a trie node persisted in the journal. type journalNode struct { @@ -70,9 +69,10 @@ type journalAccounts struct { // journalStorage represents a list of storage slots belong to an account. type journalStorage struct { - Account common.Address - Hashes []common.Hash - Slots [][]byte + Incomplete bool // Deprecated, keep it for backward compatibility + Account common.Address + Hashes []common.Hash + Slots [][]byte } // loadJournal tries to parse the layer journal from the disk.