Assume the following example. You already have a fully sync'd bitcoin node and you then build a new wallet by changing a single line from here :
Change this:
{295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")},
to:
{295000, uint256S("0x01")},
Recompile the code into a new wallet and run it on your already sync'd blockchain, but you will notice zero differences from the original wallet. Checkpoints only have an effect on nodes that have not yet synced up to the block height specified by the checkpoint. Therefore, if you take your custom built wallet and try to use it to sync a new blockchain, it will error out when it gets to block 295000 with the following error: forked chain older than last checkpoint (height 295000).
Essentially checkpoints prevent forked chains from being seen as the longest chain, since they will not be able to pass this error validation. Only new nodes and nodes that have not yet synced up to the block height specified in the checkpoint are affected.
To answer your second question, orphaned blocks have nothing to do with checkpoints. An orphaned block is the result of having two (or more) miners solve the proof-of-work challenge at the same time. Since only one of the blocks can be valid, both miners that solved the POW challenge race to notify all of their peers about the new block they found and the network temporarily splits as a result of half of the network thinking Block A is correct and the other half thinking Block B is correct. These types of splits are typically corrected in the next block, but can sometimes span more than one block if the competing chains both continue to solve their POW challenges at the exact same time (very rare but it has happened). This is precisely the reason why many exchanges and other payment services require a certain amount of confirmations before a deposit is considered valid. The more confirmations a block has, the more likely that it is the one and only valid block at that height.
what is i changed one block lets say block no 100 on source code and recompile the code when i am already synchronised with current block number in bitcoin blockchain – cryptoKTM – 2018-05-03T07:25:24.010
Checkpoints are not checked when you are fully synced, so changing a checkpoint should not effect your node. – Andrew Chow – 2018-05-03T14:52:12.460
The question is changing checkpoints and not the genesis block, so your reply doesn't seem to follow. – G. Maxwell – 2018-07-30T07:44:47.747