Skip to content

Commit

Permalink
chore(lib/trie): refactor lib/trie/database.go (#2108)
Browse files Browse the repository at this point in the history
- Explicit variable names
- Less indentation (avoid type switches)
- More return early
- Add named returns
- Clarify comments
- Wrap errors
  • Loading branch information
qdm12 authored Jan 5, 2022
1 parent 7a7fc4c commit 68da00d
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 185 deletions.
5 changes: 1 addition & 4 deletions dot/state/offline_pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ func (p *OfflinePruner) SetBloomFilter() (err error) {
return err
}

err = tr.GetNodeHashes(tr.RootNode(), keys)
if err != nil {
return err
}
tr.PopulateNodeHashes(tr.RootNode(), keys)

// get parent header of current block
header, err = p.blockState.GetHeader(header.ParentHash)
Expand Down
Loading

0 comments on commit 68da00d

Please sign in to comment.