0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-01 09:35:52 -05:00

kernel: Make bitcoin-chainstate's block validation mirror submitblock's

The behaviour of submitblock was changed in the previous commit, so
change it here too.
This commit is contained in:
TheCharlatan 2024-10-28 16:46:58 +01:00
parent bb53ce9bda
commit 73db95c65c
No known key found for this signature in database
GPG key ID: 9B79B45691DB4173

View file

@ -180,27 +180,6 @@ int main(int argc, char* argv[])
break;
}
if (block.vtx.empty() || !block.vtx[0]->IsCoinBase()) {
std::cerr << "Block does not start with a coinbase" << std::endl;
break;
}
uint256 hash = block.GetHash();
{
LOCK(cs_main);
const CBlockIndex* pindex = chainman.m_blockman.LookupBlockIndex(hash);
if (pindex) {
if (pindex->IsValid(BLOCK_VALID_SCRIPTS)) {
std::cerr << "duplicate" << std::endl;
break;
}
if (pindex->nStatus & BLOCK_FAILED_MASK) {
std::cerr << "duplicate-invalid" << std::endl;
break;
}
}
}
{
LOCK(cs_main);
const CBlockIndex* pindex = chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock);