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

Method fetchBlock

contrib/linearize/linearize-data.py:216–220  ·  view source on GitHub ↗

Fetch block contents from disk given extents

(self, extent)

Source from the content-addressed store, hash-verified

214 return os.path.join(self.settings['input'], "blk%05d.dat" % fn)
215
216 def fetchBlock(self, extent):
217 '''Fetch block contents from disk given extents'''
218 with open(self.inFileName(extent.fn), "rb") as f:
219 f.seek(extent.offset)
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.'''

Callers 1

copyOneBlockMethod · 0.95

Calls 3

inFileNameMethod · 0.95
seekMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected