From 75400a2a413c082de2ba5fc2f1da9dc86fd1d924 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 24 Aug 2014 01:18:24 -0400 Subject: [PATCH] contrib/linearize: Guarantee that output is generated in-order This was typically ensured implicitly by virtue of normal bitcoind operation. Adding an explicit check provides a stronger guarantee, and it is cheap to add. --- contrib/linearize/linearize-data.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index ea94f25faee..2d57d245f65 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -125,6 +125,12 @@ def copydata(settings, blkindex, blkset): print("Skipping unknown block " + hash_str) continue + if blkindex[blkCount] != hash_str: + print("Out of order block.") + print("Expected " + blkindex[blkCount]) + print("Got " + hash_str) + sys.exit(1) + if not fileOutput and ((outsz + inLen) > maxOutSz): outF.close() outF = None