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

Method copyOneBlock

contrib/linearize/linearize-data.py:188–198  ·  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

186 return self.read_xored(f, extent.size)
187
188 def copyOneBlock(self):
189 '''Find the next block to be written in the input, and copy it to the output.'''
190 extent = self.blockExtents.pop(self.blkCountOut)
191 if self.blkCountOut in self.outOfOrderData:
192 # If the data is cached, use it from memory and remove from the cache
193 rawblock = self.outOfOrderData.pop(self.blkCountOut)
194 self.outOfOrderSize -= len(rawblock)
195 else: # Otherwise look up data on disk
196 rawblock = self.fetchBlock(extent)
197
198 self.writeBlock(extent.inhdr, extent.blkhdr, rawblock)
199
200 def run(self):
201 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