Action taken when data of a block gets tampered with Let's say we have a Blockchain consisting of 10 blocks, indexed from 0(Genesis Block) to 9(The last block).

If the data of a block, say block 5, is changed(maliciously), the data stored on the block, as well as subsequent blocks, becomes invalid.

What happens next?

It is impractical to drop the blockchain entirely. It is also impractical to recalculate all the hashes, in case of larger chains.

So, how is data of the current block, as well as that of other blocks, preserved in the event of an attack on a single block?
I believe that if the data of one block is maliciously altered on one node, this would likely affect signatures relating to affected data. 

All other nodes would ignore any blockchain data and transactions from that node which are affected by the changes made.

For example, any other nodes obtaining that block from the malicious node would either notice that it's checksums and signatures were invalid or would notice that there is a competing chain (based on an unaltered block) which is longer and more trustworthy.

Wallet software, when synchronising, does check the validity of each block received. This means it is not impractical to do this for the entire blockchain (although it does contribute to the time that initial synchronisation takes)

Some wallets don't need to check really old blocks because they have hardcoded within them, checksums for blocks at release date. They can still distinguish blocks built upon on differing earlier blocks (because changes to significant data in earlier blocks affect the checksums of blocks built on that)

The upshot is that making changes to old blocks doesn't give anyone the ability to spend bitcoins they wouldn't otherwise have had.



Useful links


https://bitcointalk.org/index.php?topic=2129247.0
What are the trust assumptions in --assumed-valid in bitcoin core 0.14?