Browse Source

Merge pull request #5440

ebdd6bf Remove genesis block hash from error (Micha)
8d174d6 Make several small string fixes in linearize-data.py (Micha)
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
3bb29a3e13
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 8
      contrib/linearize/linearize-data.py

8
contrib/linearize/linearize-data.py

@ -148,7 +148,7 @@ class BlockDataCopier:
outFname = self.settings['output_file'] outFname = self.settings['output_file']
else: else:
outFname = "%s/blk%05d.dat" % (self.settings['output'], outFn) outFname = "%s/blk%05d.dat" % (self.settings['output'], outFn)
print("Output file" + outFname) print("Output file " + outFname)
self.outF = open(outFname, "wb") self.outF = open(outFname, "wb")
self.outF.write(inhdr) self.outF.write(inhdr)
@ -189,7 +189,7 @@ class BlockDataCopier:
while self.blkCountOut < len(self.blkindex): while self.blkCountOut < len(self.blkindex):
if not self.inF: if not self.inF:
fname = self.inFileName(self.inFn) fname = self.inFileName(self.inFn)
print("Input file" + fname) print("Input file " + fname)
try: try:
self.inF = open(fname, "rb") self.inF = open(fname, "rb")
except IOError: except IOError:
@ -205,7 +205,7 @@ class BlockDataCopier:
inMagic = inhdr[:4] inMagic = inhdr[:4]
if (inMagic != self.settings['netmagic']): if (inMagic != self.settings['netmagic']):
print("Invalid magic:" + inMagic) print("Invalid magic: " + inMagic)
return return
inLenLE = inhdr[4:] inLenLE = inhdr[4:]
su = struct.unpack("<I", inLenLE) su = struct.unpack("<I", inLenLE)
@ -292,7 +292,7 @@ if __name__ == '__main__':
blkmap = mkblockmap(blkindex) blkmap = mkblockmap(blkindex)
if not "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" in blkmap: if not "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" in blkmap:
print("not found") print("Genesis block not found in hashlist")
else: else:
BlockDataCopier(settings, blkindex, blkmap).run() BlockDataCopier(settings, blkindex, blkmap).run()

Loading…
Cancel
Save