Skip to content

Commit 2ba0f0b

Browse files
committed
test: cover feeThreshold = MAX_MONEY
1 parent 5bcd044 commit 2ba0f0b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/functional/interface_ipc_mining.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from test_framework.blocktools import NULL_OUTPOINT
1111
from test_framework.messages import (
1212
MAX_BLOCK_WEIGHT,
13+
MAX_MONEY,
1314
CTransaction,
1415
CTxIn,
1516
CTxOut,
@@ -160,12 +161,15 @@ async def async_routine():
160161
txsigops = await template.getTxSigops(ctx)
161162
assert_equal(len(txsigops.result), 0)
162163

163-
self.log.debug("Wait for a new template")
164+
self.log.debug("Wait for a new template, get one after the tip updates")
164165
waitoptions = self.capnp_modules['mining'].BlockWaitOptions()
165166
waitoptions.timeout = timeout
166-
waitoptions.feeThreshold = 1
167+
# Ignore fee increases, wait only for the tip update
168+
waitoptions.feeThreshold = MAX_MONEY
169+
self.miniwallet.send_self_transfer(fee_rate=10, from_node=self.nodes[0])
167170
template2 = await wait_and_do(
168171
mining_wait_next_template(template, stack, ctx, waitoptions),
172+
# This mines the transaction, so it won't be in the next template
169173
lambda: self.generate(self.nodes[0], 1))
170174
assert template2 is not None
171175
block2 = await mining_get_block(template2, ctx)
@@ -176,6 +180,7 @@ async def async_routine():
176180
assert template3 is None
177181

178182
self.log.debug("Wait for another, get one after increase in fees in the mempool")
183+
waitoptions.feeThreshold = 1
179184
template4 = await wait_and_do(
180185
mining_wait_next_template(template2, stack, ctx, waitoptions),
181186
lambda: self.miniwallet.send_self_transfer(fee_rate=10, from_node=self.nodes[0]))

0 commit comments

Comments
 (0)