Skip to content

Instantly share code, notes, and snippets.

@alfondotnet
Last active April 13, 2021 16:54
Show Gist options
  • Save alfondotnet/1f2376de88ae7fb015a4afc891d56776 to your computer and use it in GitHub Desktop.
Save alfondotnet/1f2376de88ae7fb015a4afc891d56776 to your computer and use it in GitHub Desktop.
from datetime import datetime
import re
file = open('/home/fon/.chia/mainnet/log/debug.log')
suffixes = ["", ".1", ".2", ".3", ".4", ".5", ".6", ".7"]
finished_compiled = re.compile(r'Finished signage point (\d+)\/\d+')
for s in suffixes:
with open(f'/home/fon/.chia/mainnet/log/debug.log{s}') as file:
gaps = []
old_signage_count = None
for l in file:
if 'Finished signage point' not in l:
continue
curr_signage_count = int(re.search(finished_compiled, l)[1])
if old_signage_count is None or curr_signage_count == 1 and old_signage_count == 63:
old_signage_count = curr_signage_count
continue
elif curr_signage_count - old_signage_count != 1:
gaps.append(l)
old_signage_count = curr_signage_count
print(f"/home/fon/.chia/mainnet/log/debug.log{s}")
print(f"\tGaps: {gaps}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment