BlockchainCharlotte / blockchain

A simple Blockchain in Python
MIT License
0 stars 2 forks source link

Add ability to broadcast and receive blocks #10

Open jcopley opened 7 years ago

jcopley commented 7 years ago

Create an endpoint to receive a complete block.

When a block is received:

  1. The block index(?), transactions and previous hash are checked to verify that it is a valid addition to the current chain, and not a duplicate. If valid:
  2. The block is added to the current chain.
  3. Current transactions are purged of any transactions that appear in the new block.
  4. The block is re-sent to remaining nodes.

When a new block is mined, it will be sent to other nodes.

lancekrogers commented 6 years ago

Add ability to replace tip of the chain instead of replacing the whole chain