MultiversX Tracker is Live!

Does local blockchain database (blkXXXXX.dat) contain abandoned forks forever?

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 171 Views

When my node realizes that the given block needs to be abandoned - does it leave it in the database or replace the block with a valid one?

It remains on disk along with its entry in the block index database.

And if "invalid" block remains: is it somehow marked as invalid?

Yes. The block index database contains an entry for each block which contains flags that indicate the state of the block. This includes various states of validity and invalidity (that indicate where it passed or failed certain checks).

If I meet two blocks with the same parent in the blockchain - how could I know which branch should I follow?

Your node will follow the valid chain with the most cumulative work. At a given difficulty, this is the longest chain, but that is not always the case. If there are two blocks that have the same cumulative work, the node chooses the one it saw first. Eventually there will be a resolution as one of those blocks will be mined on and so have a greater cumulative work.


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments