From 8d174d6b5dc012d9191fddc53bb92ea780a4bb77 Mon Sep 17 00:00:00 2001 From: Micha Date: Sun, 7 Dec 2014 17:55:53 +0200 Subject: [PATCH 1/2] Make several small string fixes in linearize-data.py - Add a space after the fixed string prepended to file names when input or output file changes - Clarify the error message when the genesis block is not found in the hash list (...why do we have this at all?) --- contrib/linearize/linearize-data.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 2dac3a614..e7a8762eb 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -148,7 +148,7 @@ class BlockDataCopier: outFname = self.settings['output_file'] else: outFname = "%s/blk%05d.dat" % (self.settings['output'], outFn) - print("Output file" + outFname) + print("Output file " + outFname) self.outF = open(outFname, "wb") self.outF.write(inhdr) @@ -189,7 +189,7 @@ class BlockDataCopier: while self.blkCountOut < len(self.blkindex): if not self.inF: fname = self.inFileName(self.inFn) - print("Input file" + fname) + print("Input file " + fname) try: self.inF = open(fname, "rb") except IOError: @@ -205,7 +205,7 @@ class BlockDataCopier: inMagic = inhdr[:4] if (inMagic != self.settings['netmagic']): - print("Invalid magic:" + inMagic) + print("Invalid magic: " + inMagic) return inLenLE = inhdr[4:] su = struct.unpack(" Date: Mon, 8 Dec 2014 13:55:12 +0200 Subject: [PATCH 2/2] Remove genesis block hash from error --- contrib/linearize/linearize-data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index e7a8762eb..f59fe9f6e 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -292,7 +292,7 @@ if __name__ == '__main__': blkmap = mkblockmap(blkindex) if not "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" in blkmap: - print("Genesis block (000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f) not found in hashlist") + print("Genesis block not found in hashlist") else: BlockDataCopier(settings, blkindex, blkmap).run()