In main.h (line 17) we have a constant MAX_SIZE
static const unsigned int MAX_SIZE = 0x02000000;
which in decimal format equals to 33554432 (32MB)
This constant is used to verify if the block passes the size limit in main.cpp (line 1154)
bool CBlock::CheckBlock() const
{
// These are checks that are independent of context
// that can be verified before saving an orphan block.
// Size limits
if (vtx.empty() || vtx.size() > MAX_SIZE || ::GetSerializeSize(*this, SER_DISK) > MAX_SIZE)
return error("CheckBlock() : size limits failed");
...
}
According to the git pull request history line 18 was added to main.h by Gavin Andresen:
static const unsigned int MAX_BLOCK_SIZE = 1000000;
https://github.com/bitcoin/bitcoin/blame/9d2174b6f5f3fac2463c7ebc2dbb9004b3740d23/main.h
this new constant appears to only be used on the BitcoinMiner() function on main.cpp
https://github.com/bitcoin/bitcoin/blame/9d2174b6f5f3fac2463c7ebc2dbb9004b3740d23/main.cpp#L2613
if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE - 10000)
continue;
Apparently Satoshi believed that this would split the chain but this is only established on the mining node, not on a node that is just collecting new block and adding them to their chain.
What is the significance of this last line? How does this impact consensus? Where is the code limiting block size in the most current version of Bitcoin Core?