Skip to content

Commit

Permalink
Fix IncompleteDatabase error
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Oct 7, 2024
1 parent 230be4a commit 3372d31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions substrate/client/db/src/trie_committer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ impl<'a, S: 'a + TrieBackendStorage<H>, H: Hasher> hash_db::HashDB<H, DBValue>
for TrieCommitter<'a, S, H>
{
fn get(&self, key: &H::Out, prefix: Prefix) -> Option<DBValue> {
if prefix == sp_trie::EMPTY_PREFIX {
return Some([0u8].to_vec());
}

let db_key = sp_trie::prefixed_key::<H>(key, prefix);

self.trie_database.get(columns::STATE, &db_key).or_else(|| {
Expand Down

0 comments on commit 3372d31

Please sign in to comment.