MCPcopy Create free account
hub / github.com/CPChain/chain / retrieve

Method retrieve

core/state/iterator.go:133–154  ·  view source on GitHub ↗

retrieve pulls and caches the current state entry the iterator is traversing. The method returns whether there are any more data left for inspection.

()

Source from the content-addressed store, hash-verified

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.
133func (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}

Callers 1

NextMethod · 0.95

Calls 1

HashMethod · 0.65

Tested by

no test coverage detected