triedb/pathdb: search account with address length

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2025-07-21 14:54:32 +08:00
parent f17df6db91
commit a611a5e250

View file

@ -210,7 +210,7 @@ func (r *historyReader) readAccountMetadata(address common.Address, historyID ui
n := len(blob) / accountIndexSize n := len(blob) / accountIndexSize
pos := sort.Search(n, func(i int) bool { pos := sort.Search(n, func(i int) bool {
h := blob[accountIndexSize*i : accountIndexSize*i+common.HashLength] h := blob[accountIndexSize*i : accountIndexSize*i+common.AddressLength]
return bytes.Compare(h, address.Bytes()) >= 0 return bytes.Compare(h, address.Bytes()) >= 0
}) })
if pos == n { if pos == n {