MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / copyOneBlock

Method copyOneBlock

contrib/linearize/linearize-data.py:222–232  ·  view source on GitHub ↗

Find the next block to be written in the input, and copy it to the output.

(self)

Source from the content-addressed store, hash-verified

220 return f.read(extent.size)
221
222 def copyOneBlock(self):
223 '''Find the next block to be written in the input, and copy it to the output.'''
224 extent = self.blockExtents.pop(self.blkCountOut)
225 if self.blkCountOut in self.outOfOrderData:
226 # If the data is cached, use it from memory and remove from the cache
227 rawblock = self.outOfOrderData.pop(self.blkCountOut)
228 self.outOfOrderSize -= len(rawblock)
229 else: # Otherwise look up data on disk
230 rawblock = self.fetchBlock(extent)
231
232 self.writeBlock(extent.inhdr, extent.blkhdr, rawblock)
233
234 def run(self):
235 while self.blkCountOut < len(self.blkindex):

Callers 1

runMethod · 0.95

Calls 2

fetchBlockMethod · 0.95
writeBlockMethod · 0.95

Tested by

no test coverage detected