tylermzeller / pychain

An experimental blockchain in Python
MIT License
0 stars 0 forks source link

Same coinbase get's used in every block #9

Closed tylermzeller closed 6 years ago

tylermzeller commented 6 years ago

There is a major bug where the same coinbase tx is used for every block. This is because the coinbase is first created then appended to the default list argument of transactions in the mine_block method

def mine_block(self, transactions=[]):
        . . .
        if len(transactions) == 0: 
                transactions.append(self.newCoinbaseTX())