Savjee / SavjeeCoin

A simple blockchain in Javascript. For educational purposes only.
MIT License
1.74k stars 752 forks source link

Check sender and receiver are different #52

Closed Ricardicus closed 2 years ago

Ricardicus commented 2 years ago

I am not sure if this is true, but can a block contain such transfers?

Savjee commented 2 years ago

This seems to be allowed: https://bitcoin.stackexchange.com/questions/12746/can-a-bitcoin-transaction-have-the-same-address-for-input-and-output

I also added a test for this case to make sure that the balance stays the same when you transfer coins to the same wallet: https://github.com/Savjee/SavjeeCoin/commit/af230c82f200f099561303cc4468cc003c73d19a

Sorry, closing this for now.