retrieve pulls and caches the current state entry the iterator is traversing. The method returns whether there are any more data left for inspection.
()
| 131 | // retrieve pulls and caches the current state entry the iterator is traversing. |
| 132 | // The method returns whether there are any more data left for inspection. |
| 133 | func (it *NodeIterator) retrieve() bool { |
| 134 | // Clear out any previously set values |
| 135 | it.Hash = common.Hash{} |
| 136 | |
| 137 | // If the iteration's done, return no available data |
| 138 | if it.state == nil { |
| 139 | return false |
| 140 | } |
| 141 | // Otherwise retrieve the current entry |
| 142 | switch { |
| 143 | case it.dataIt != nil: |
| 144 | it.Hash, it.Parent = it.dataIt.Hash(), it.dataIt.Parent() |
| 145 | if it.Parent == (common.Hash{}) { |
| 146 | it.Parent = it.accountHash |
| 147 | } |
| 148 | case it.code != nil: |
| 149 | it.Hash, it.Parent = it.codeHash, it.accountHash |
| 150 | case it.stateIt != nil: |
| 151 | it.Hash, it.Parent = it.stateIt.Hash(), it.stateIt.Parent() |
| 152 | } |
| 153 | return true |
| 154 | } |