Mercurial > public > bitcaviar-plus
view main.py @ 8:4d259e84160d
fix OverFlow bug
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 24 Oct 2021 17:38:23 +0200 |
parents | e4afde8d5a7e |
children | e218f70e19e9 |
line wrap: on
line source
import os from puppy.block import deserialize_block def main(): filename = '/Users/dennis/Bitcoin/blocks/blk00000.dat' file_size = os.path.getsize(filename) print('File size in bytes: {}'. format(file_size)) with open(filename, 'rb') as f: while f.tell() < file_size: block = deserialize_block(f) if __name__ == '__main__': main()