mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
pathdb: fix golang ci lint
This commit is contained in:
parent
37c54c7aa5
commit
7a8aa42c63
1 changed files with 1 additions and 5 deletions
|
|
@ -85,12 +85,8 @@ func nodeBloomHash(h common.Hash, p []byte) uint64 {
|
|||
}
|
||||
|
||||
func pathBloomHash(p []byte) uint64 {
|
||||
if len(p) > 16 {
|
||||
panic("invalid path")
|
||||
}
|
||||
var result uint64
|
||||
for _, nibble := range p {
|
||||
// 检查每个 nibble 是否在有效范围内(0-15)
|
||||
if nibble > 0x0F {
|
||||
panic("invalid path nibble value")
|
||||
}
|
||||
|
|
@ -191,7 +187,7 @@ func (dl *diffLayer) rebloom(origin *diskLayer) {
|
|||
if dl.selfDiffed == nil {
|
||||
dl.selfDiffed, _ = dl.diffed.NewCompatible()
|
||||
for owner, subset := range dl.nodes {
|
||||
for path, _ := range subset {
|
||||
for path := range subset {
|
||||
dl.selfDiffed.AddHash(nodeBloomHash(owner, []byte(path)))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue