rpc: Round verificationprogress to exactly 1 for a recent tip

This requires a new lock annotation, but all relevant callers already
held the lock.
This commit is contained in:
MarcoFalke
2025-05-16 13:32:23 +02:00
parent faf6304bdf
commit fa76b378e4
4 changed files with 23 additions and 5 deletions

View File

@@ -286,7 +286,13 @@ class BlockchainTest(BitcoinTestFramework):
future = 2 * 60 * 60
self.nodes[0].setmocktime(self.nodes[0].getblockchaininfo()["time"] + future + 1)
assert_greater_than(1, self.nodes[0].getblockchaininfo()["verificationprogress"])
self.log.info("Check that verificationprogress is exactly 1 for a recent block tip")
self.nodes[0].setmocktime(self.nodes[0].getblockchaininfo()["time"] + future)
assert_equal(1, self.nodes[0].getblockchaininfo()["verificationprogress"])
self.log.info("Check that verificationprogress is less than 1 as soon as a new header comes in")
self.nodes[0].submitheader(self.generateblock(self.nodes[0], output="raw(55)", transactions=[], submit=False, sync_fun=self.no_op)["hex"])
assert_greater_than(1, self.nodes[0].getblockchaininfo()["verificationprogress"])
def _test_y2106(self):