diff options
author | Magnus Ahltorp <map@kth.se> | 2015-03-04 15:42:59 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-03-04 15:42:59 +0100 |
commit | e0f11a58033d52c70bc76b4b5611cb88485d4653 (patch) | |
tree | 41907841f09f19d93adfab91eb314bb0789851f9 /tools/merge.py | |
parent | ff18e0fdd57a6b485f427173fe7febee03345037 (diff) |
Save STH instead of calculating a new one each time.
Diffstat (limited to 'tools/merge.py')
-rwxr-xr-x | tools/merge.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/merge.py b/tools/merge.py index 0996ec9..c137f4b 100755 --- a/tools/merge.py +++ b/tools/merge.py @@ -239,7 +239,10 @@ for frontendnode in frontendnodes: print "current position", curpos entries = [base64.b64encode(entry) for entry in logorder[curpos:]] for chunk in chunks(entries, 1000): - sendlog(frontendnode, {"start": curpos, "hashes": chunk}) + sendlogresult = sendlog(frontendnode, {"start": curpos, "hashes": chunk}) + if sendlogresult["result"] != "ok": + print "sendlog:", sendlogresult + sys.exit(1) curpos += len(chunk) print curpos, sys.stdout.flush() @@ -250,8 +253,14 @@ for frontendnode in frontendnodes: print "missing entries:", len(missingentries) for missingentry in missingentries: hash = base64.b64decode(missingentry) - sendentry(frontendnode, read_chain(hash), hash) + sendentryresult = sendentry(frontendnode, read_chain(hash), hash) + if sendentryresult["result"] != "ok": + print "send sth:", sendentryresult + sys.exit(1) timing_point(timing, "send missing") - sendsth(frontendnode, sth) + sendsthresult = sendsth(frontendnode, sth) + if sendsthresult["result"] != "ok": + print "send sth:", sendsthresult + sys.exit(1) timing_point(timing, "send sth") print timing["deltatimes"] |