Sorry, if the question may seem trivial but it is bothering me for a while now. I understood how the proof of concept works when one tries to change an old block. But how that will work for the case of the latest block?
For example, say I am an attacker who continuously mines blocks. Every time when I get a request for a new block, I will add a fraudulent transaction to it even before trying to find the hash. And I do that every time I get a request for a new block. If I was not able to successfully find a new block before someone it's okay, I will just discard my current work on the fraudulent block, will accept the honest block and again will repeat the same with the new block.
After a while, I ought to be lucky and my fraudulent block will be the first one that is published into the network. When that happens my block will be part of the honest chain and there will be no way to find out about this.
How Blockchain prevents this kind of attack?