Next moves the iterator to the next node, returning whether there are any further nodes. In case of an internal error this method returns false and sets the Error field to the encountered failure.
()
| 54 | // further nodes. In case of an internal error this method returns false and |
| 55 | // sets the Error field to the encountered failure. |
| 56 | func (it *NodeIterator) Next() bool { |
| 57 | // If the iterator failed previously, don't do anything |
| 58 | if it.Error != nil { |
| 59 | return false |
| 60 | } |
| 61 | // Otherwise step forward with the iterator and report any errors |
| 62 | if err := it.step(); err != nil { |
| 63 | it.Error = err |
| 64 | return false |
| 65 | } |
| 66 | return it.retrieve() |
| 67 | } |
| 68 | |
| 69 | // step moves the iterator to the next entry of the state trie. |
| 70 | func (it *NodeIterator) step() error { |