xaya / xaya

XAYA Core
https://xaya.io
MIT License
101 stars 56 forks source link

checkblocks fails to validate the genesis block #49

Closed domob1812 closed 6 years ago

domob1812 commented 6 years ago

The startup validation of the last few blocks (configurable with -checkblocks) seems to fail for the genesis block. Reindexing works fine.

This is not a big deal, as there are already more blocks in the chain than the default value of six. So unless someone plays around with the argument or restarts with fewer than six blocks synced, it will work fine. Nevertheless, we should understand and fix this at least for future releases.

domob1812 commented 6 years ago

This is caused by some legacy code in ApplyTxInUndo, which actually doesn't "support" any non-coinbase transaction in block 1. This is not an issue for Bitcoin or Namecoin, as they don't have transactions in block 1. Xaya does, so there the check fails. We can easily fix it by just removing the legacy code, though, as it is used to support old undo data formats that are not relevant for Xaya.