aboutsummaryrefslogtreecommitdiff
path: root/contrib/linearize/linearize-data.py
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2014-08-24 01:18:24 -0400
committerJeff Garzik <jgarzik@bitpay.com>2014-08-24 01:18:24 -0400
commit75400a2a413c082de2ba5fc2f1da9dc86fd1d924 (patch)
tree92da0c937a5428e1d7ae18de34085d352f73d6ae /contrib/linearize/linearize-data.py
parent087eb43cff13e3ba3cc34f047acaab861f723204 (diff)
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.
Diffstat (limited to 'contrib/linearize/linearize-data.py')
-rwxr-xr-xcontrib/linearize/linearize-data.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py
index ea94f25fae..2d57d245f6 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