Skip to content

Commit

Permalink
test: fix pathdb unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
VM committed Sep 11, 2024
1 parent e381d88 commit d5a0b88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions triedb/pathdb/nodebufferlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ func (nf *nodebufferlist) getAllNodes() map[common.Hash]map[string]*trienode.Nod
defer nf.mux.Unlock()
defer nf.baseMux.Unlock()

if nf.useBase.Load() {
return nf.base.nodes
}

nc := newMultiDifflayer(nf.limit, 0, common.Hash{}, make(map[common.Hash]map[string]*trienode.Node), 0)
if err := nc.commit(nf.base.root, nf.base.id, nf.base.block, nf.layers, nf.base.nodes); err != nil {
log.Crit("failed to commit nodes to node buffer", "error", err)
Expand Down

0 comments on commit d5a0b88

Please sign in to comment.