In case we know there are unprocessed blocks in the chain (because we have their headers), we shouldn’t say progress: 1
I agree we should not return 1 if we didn’t verify the last block we know (we don’t want Core to lie to users 😉)
What if we do something like:
0const auto block_time{(pindex->nHeight == m_best_header->nHeight && pindex->nChainWork == m_best_header->nChainWork)
1 ? pindex->GetBlockTime() + Ticks<std::chrono::seconds>(2h)
2 : pindex->GetBlockTime()};
So we return 1 if we are in the best known header and inside the two hours offset.
02025-05-19T22:32:55Z UpdateTip: new best=000000000000000000007de21c2c10adec3376d6f0c69f24ba143dc572497b87 height=897462 version=0x202c2000 log2_work=95.617541 tx=1192584903 date='2025-05-19T22:05:52Z' progress=0.999994 cache=111.4MiB(825445txo)
12025-05-19T22:32:55Z UpdateTip: new best=00000000000000000001efdca54c71c76ae3c06b54598ff50fc20b48a01149ab height=897463 version=0x292e4000 log2_work=95.617554 tx=1192586948 date='2025-05-19T22:07:05Z' progress=1.000000 cache=111.9MiB(829042txo)
0$ bitcoin-cli getblockchaininfo
1 "chain": "main",
2 "blocks": 897463,
3 "headers": 897463,
4....
5 "verificationprogress": 1,
6...