Skip to content

Commit 6e1f767

Browse files
committed
triedb/pathdb: skip unused recursive call
1 parent 929401f commit 6e1f767

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

triedb/pathdb/difflayer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ func (dl *diffLayer) node(owner common.Hash, path []byte, hash common.Hash, dept
192192
persistLayer := dl.originDiskLayer()
193193
if hash != (common.Hash{}) && persistLayer != nil {
194194
blob, rhash, nloc, err := persistLayer.node(owner, path, hash, depth+1)
195-
if err != nil || rhash != hash {
195+
if err != nil {
196+
return nil, common.Hash{}, nil, err
197+
}
198+
if rhash != hash {
196199
// This is a bad case with a very low probability.
197200
// r/w the difflayer cache and r/w the disklayer are not in the same lock,
198201
// so in extreme cases, both reading the difflayer cache and reading the disklayer may fail, eg, disklayer is stale.

0 commit comments

Comments
 (0)