Function
stateTreeNodePath
(ctx context.Context, tree *stateTree, p path.Node)
Source from the content-addressed store, hash-verified
| 140 | } |
| 141 | |
| 142 | func stateTreeNodePath(ctx context.Context, tree *stateTree, p path.Node) ([]uint64, error) { |
| 143 | n := tree.root |
| 144 | indices := []uint64{} |
| 145 | for { |
| 146 | ci := n.findByPath(ctx, p, tree) |
| 147 | if ci == nil { |
| 148 | break |
| 149 | } |
| 150 | for _, i := range ci { |
| 151 | n, indices = n.children[i], append(indices, i) |
| 152 | } |
| 153 | } |
| 154 | return indices, nil |
| 155 | } |
| 156 | |
| 157 | type errIndexOOB struct { |
| 158 | idx, count uint64 |