I have carried out a customized blockchain in Node.js, the place each and every node communicates the use of sockets. These days, when two miners mine the similar transaction, they each upload it to their chain and percentage the block with everybody. When a miner receives a replica block (from any other miner), it compares the timestamps and replaces its personal block with the sooner block if the won block has an previous timestamp. This implies the miner would take away its personal block and upload the block with the similar transaction that was once mined sooner than.
I understand this isn’t a standard blockchain structure, as we should not be in a position to modify the blockchain (i.e., take away blocks). How can I change my implementation to make sure that most effective the earliest mined block will get added to the entire nodes with out getting rid of information from their variations of the blockchain? I am searching for an alternate means that clings extra intently to conventional blockchain rules. If you want additional information or rationalization, please let me know and I will feel free to offer additional main points.