mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-23 12:14:30 +01:00
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:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user