Changeset View
Changeset View
Standalone View
Standalone View
contrib/linearize/linearize-data.py
Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | def run(self): | ||||
inLenLE = inhdr[4:] | inLenLE = inhdr[4:] | ||||
su = struct.unpack("<I", inLenLE) | su = struct.unpack("<I", inLenLE) | ||||
inLen = su[0] - 80 # length without header | inLen = su[0] - 80 # length without header | ||||
blk_hdr = self.inF.read(80) | blk_hdr = self.inF.read(80) | ||||
inExtent = BlockExtent( | inExtent = BlockExtent( | ||||
self.inFn, self.inF.tell(), inhdr, blk_hdr, inLen) | self.inFn, self.inF.tell(), inhdr, blk_hdr, inLen) | ||||
self.hash_str = calc_hash_str(blk_hdr) | self.hash_str = calc_hash_str(blk_hdr) | ||||
if not self.hash_str in blkmap: | if self.hash_str not in blkmap: | ||||
# Because blocks can be written to files out-of-order as of 0.10, the script | # Because blocks can be written to files out-of-order as of 0.10, the script | ||||
# may encounter blocks it doesn't know about. Treat as debug output. | # may encounter blocks it doesn't know about. Treat as debug output. | ||||
if settings['debug_output'] == 'true': | if settings['debug_output'] == 'true': | ||||
print("Skipping unknown block " + self.hash_str) | print("Skipping unknown block " + self.hash_str) | ||||
self.inF.seek(inLen, os.SEEK_CUR) | self.inF.seek(inLen, os.SEEK_CUR) | ||||
continue | continue | ||||
blkHeight = self.blkmap[self.hash_str] | blkHeight = self.blkmap[self.hash_str] | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |