mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 17:24:58 +02:00
mining: enforce minimum reserved weight for IPC
Previously a lower value was silently clamped to MINIMUM_BLOCK_RESERVED_WEIGHT.
This commit is contained in:
@@ -257,6 +257,15 @@ class IPCMiningTest(BitcoinTestFramework):
|
||||
empty_block = await mining_get_block(empty_template, ctx)
|
||||
assert_equal(len(empty_block.vtx), 1)
|
||||
|
||||
self.log.debug("Enforce minimum reserved weight for IPC clients too")
|
||||
opts.blockReservedWeight = 0
|
||||
try:
|
||||
await mining.createNewBlock(opts)
|
||||
raise AssertionError("createNewBlock unexpectedly succeeded")
|
||||
except capnp.lib.capnp.KjException as e:
|
||||
assert_equal(e.description, "remote exception: std::exception: block_reserved_weight (0) must be at least 2000 weight units")
|
||||
assert_equal(e.type, "FAILED")
|
||||
|
||||
asyncio.run(capnp.run(async_routine()))
|
||||
|
||||
def run_coinbase_and_submission_test(self):
|
||||
|
||||
Reference in New Issue
Block a user