rpc: have mintime account for timewarp rule

Previously in getblocktemplate only curtime took the timewarp rule into account.

Mining pool software could use either, though in general it should use curtime.
This commit is contained in:
Sjors Provoost
2025-01-29 09:27:09 +01:00
parent 79d45b10f1
commit 0082f6acc1
2 changed files with 5 additions and 2 deletions

View File

@@ -153,6 +153,8 @@ class MiningTest(BitcoinTestFramework):
# The template will have an adjusted timestamp, which we then modify
tmpl = node.getblocktemplate(NORMAL_GBT_REQUEST_PARAMS)
assert_greater_than_or_equal(tmpl['curtime'], t + MAX_FUTURE_BLOCK_TIME - MAX_TIMEWARP)
# mintime and curtime should match
assert_equal(tmpl['mintime'], tmpl['curtime'])
block = CBlock()
block.nVersion = tmpl["version"]