2
0
I tried to search for answers to my questions, but didn't find any, but please forgive me if this is a duplicate question.
Suppose somehow .bitcoin/chainstate gets corrupted, e.g., a UTXO is deleted. I suppose that this node will then try to reject any blocks that contains a transaction that tries to use the deleted UTXO?
Or will the node somehow detect that its chainstate has been corrupted, and rescan the blockchain? If this is the case, how would the node detect this?
Finally, suppose all of the node's chainstate was corrupted in exactly the same way, a UTXO was deleted. Then is this UTXO effectively gone, even though it remains in the blockchain.
Thank you.
1That's correct. A consistency check is done at startup comparing the UTXO with the last few blocks, but if the corruption occurs in a UTXO that was not touched by those blocks, you're out of luck. – Pieter Wuille – 2019-08-13T15:31:43.260
@PieterWuille Thank you for the confirmation! – siyopao – 2019-08-14T00:23:33.013
@PieterWuille I assume the chain state does include a checksum as part of the consistency check, which would basically detect any accidental corruption? – Jannes – 2019-08-17T12:00:51.490
1@Jannes It's a LevelDB database, which has checksums internally. – Pieter Wuille – 2019-08-17T14:54:11.420