comparison src/block_structure.py @ 5:1a8d94b500d8

finish basic parser
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Thu, 21 Oct 2021 18:52:54 +0200
parents e7a84094bf07
children
comparison
equal deleted inserted replaced
4:e7a84094bf07 5:1a8d94b500d8
1 class Block: 1 class Block:
2 h = str() # Block hash 2 block_hash = str() # Block hash
3 header = dict() 3 header = dict()
4 transactions = []
5 4
6 5
7 class Header: 6 class Header:
8 version = int() 7 version = int()
9 previous_block_hash = str() 8 previous_block_hash = str()
12 bits = int() 11 bits = int()
13 nonce = int() 12 nonce = int()
14 13
15 14
16 class Transaction: 15 class Transaction:
16 id = str()
17 version = int() 17 version = int()
18 inputs = []
19 outputs = []
20 lock_time = int() 18 lock_time = int()
21 19
22 20
23 class TransactionInput: 21 class TransactionInput:
24 is_coinbase = False 22 is_coinbase = False