Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and rename blocks.py to update_blocks.py #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions blocks.py → update_blocks.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
from pybitcointools import *
import rlp
import re
from transactions import Transaction
from trie import Trie
import sys

class Block():
def __init__(self,data=None):

if not data:
return

if re.match('^[0-9a-fA-F]*$',data):
data = data.decode('hex')

header, transaction_list, self.uncles = rlp.decode(data)
[ self.number,
self.prevhash,
self.uncles_root,
self.coinbase,
state_root,
self.transactions_root,
self.difficulty,
self.timestamp,
self.nonce,
self.extra ] = header
self.transactions = [Transaction(x) for x in transaction_list]
self.state = Trie('statedb',state_root)
self.reward = 0
Expand Down