v31.1-roots.1 · Commit 4: [PATCH 04/17] feat(mining): preserve Roots priority and template policies
test/functional/mempool_subdust_fee_penalty.py
Before: test/functional/mempool_subdust_fee_penalty.py · After: test/functional/mempool_subdust_fee_penalty.py
File metadata
index 5af44872f9dab968de0ab3874808c16275bff870..3f903e58d575c359a964c94a39b88132e3ed294c 100644
Download original patch · Release notes
Diff rows 1–33 of 33. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
test/functional/mempool_subdust_fee_penalty.py
CHANGED
|
@@ -326,7 +326,7 @@ class SubDustFeePenaltyTest(BitcoinTestFramework):
|
|
|
326
326
|
def test_mining_and_block_acceptance(self):
|
|
327
327
|
self.log.info("Templates select modified fees, while blocks reward actual fees and accept local rejects")
|
|
328
328
|
node = self.nodes[0]
|
|
329
|
-
self.reset_policy("-blockmintxfee=0.00002")
|
|
329
|
+
self.reset_policy("-blockprioritysize=0", "-blockmintxfee=0.00002")
|
|
330
330
|
probe = self.build_tx_with_dust([0], 1000)
|
|
331
331
|
min_fee = self.get_min_relay_fee(probe)
|
|
332
332
|
low = self.build_tx_with_dust([0], min_fee)
|
|
@@ -353,12 +353,22 @@ class SubDustFeePenaltyTest(BitcoinTestFramework):
|
|
|
353
353
|
assert txid in [entry["txid"] for entry in mined["tx"]]
|
|
354
354
|
# Regtest at this height has a 25 BTC subsidy. Penalty/delta do not alter reward.
|
|
355
355
|
assert_equal(sum(output["value"] for output in mined["tx"][0]["vout"]), Decimal(25) + Decimal(fee) / COIN)
|
|
356
|
-
self.reset_policy("-blockmintxfee=0.00002", "-subdustfeepenalty=0")
|
|
356
|
+
self.reset_policy("-blockprioritysize=0", "-blockmintxfee=0.00002", "-subdustfeepenalty=0")
|
|
357
357
|
tx = self.build_tx_with_dust([0], fee)
|
|
358
358
|
txid = node.sendrawtransaction(tx.serialize().hex())
|
|
359
359
|
assert txid in [entry["txid"] for entry in node.getblocktemplate({"rules": ["segwit"]})["transactions"]]
|
|
360
|
-
# Priority-area selection is verified with its native L9 implementation.
|
|
361
|
-
|
|
360
|
+
self.reset_policy("-blockprioritysize=100000", "-blockmintxfee=0.00002")
|
|
361
|
+
# The explicit priority area can mine sufficiently aged coins below the
|
|
362
|
+
# template's fee floor. The dust penalty still appears in entry accounting.
|
|
363
|
+
tx = self.build_tx_with_dust([0], DUST_THRESHOLD + min_fee)
|
|
364
|
+
txid = node.sendrawtransaction(tx.serialize().hex())
|
|
365
|
+
assert_equal(node.getmempoolentry(txid)["fees"]["modified"], Decimal(min_fee) / COIN)
|
|
366
|
+
assert txid in [entry["txid"] for entry in node.getblocktemplate({"rules": ["segwit"]})["transactions"]]
|
|
367
|
+
self.generate(self.wallet, 1)
|
|
368
|
+
mined = node.getblock(node.getbestblockhash(), 2)
|
|
369
|
+
assert_equal([entry["txid"] for entry in mined["tx"]][1:], [txid])
|
|
370
|
+
assert_equal(sum(output["value"] for output in mined["tx"][0]["vout"]),
|
|
371
|
+
Decimal(25) + Decimal(DUST_THRESHOLD + min_fee) / COIN)
|
|
362
372
|
|
|
363
373
|
|
|
364
374
|
if __name__ == '__main__':
|