mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
trie/bintrie: guard LeafProof against single-stem trees
This commit is contained in:
parent
9769a68c84
commit
7351d8d1c1
1 changed files with 6 additions and 0 deletions
|
|
@ -246,6 +246,12 @@ func (it *binaryNodeIterator) LeafProof() [][]byte {
|
|||
|
||||
proof := make([][]byte, 0, len(it.stack)+StemNodeWidth)
|
||||
|
||||
if len(it.stack) < 2 {
|
||||
proof = append(proof, sn.Stem[:])
|
||||
proof = append(proof, sn.allValues()...)
|
||||
return proof
|
||||
}
|
||||
|
||||
for i := range it.stack[:len(it.stack)-2] {
|
||||
state := it.stack[i]
|
||||
internalNode := it.store.getInternal(state.Node.Index())
|
||||
|
|
|
|||
Loading…
Reference in a new issue