mining: enforce minimum reserved weight for IPC

Previously a lower value was silently clamped to MINIMUM_BLOCK_RESERVED_WEIGHT.
This commit is contained in:
Sjors Provoost committed 2026-02-07 13:57:33 +01:00
1 parent d3e49528d4
commit b623fab1ba
3 files changed
+22 -1

No files matched your search

+9
View File
@@ -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):