Don't return a feerate less than minrelaytxfee/mempoolminfee.
(node_factory, bitcoind, anchors)
| 2291 | @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Fees on elements are different") |
| 2292 | @pytest.mark.parametrize("anchors", [False, True]) |
| 2293 | def test_bitcoind_feerate_floor(node_factory, bitcoind, anchors): |
| 2294 | """Don't return a feerate less than minrelaytxfee/mempoolminfee.""" |
| 2295 | opts = {} |
| 2296 | if anchors is False: |
| 2297 | opts['dev-force-features'] = "-23" |
| 2298 | l1 = node_factory.get_node(options=opts) |
| 2299 | |
| 2300 | assert l1.rpc.feerates('perkb') == { |
| 2301 | "perkb": { |
| 2302 | "opening": 30000, |
| 2303 | "mutual_close": 15000, |
| 2304 | "unilateral_close": 44000, |
| 2305 | 'unilateral_anchor_close': 15000, |
| 2306 | "penalty": 30000, |
| 2307 | "splice": 30020, |
| 2308 | "min_acceptable": 7500, |
| 2309 | "max_acceptable": 600000, |
| 2310 | "floor": 1012, |
| 2311 | "estimates": [{"blockcount": 2, |
| 2312 | "feerate": 60000, |
| 2313 | "smoothed_feerate": 60000}, |
| 2314 | {"blockcount": 6, |
| 2315 | "feerate": 44000, |
| 2316 | "smoothed_feerate": 44000}, |
| 2317 | {"blockcount": 12, |
| 2318 | "feerate": 30000, |
| 2319 | "smoothed_feerate": 30000}, |
| 2320 | {"blockcount": 100, |
| 2321 | "feerate": 15000, |
| 2322 | "smoothed_feerate": 15000}], |
| 2323 | }, |
| 2324 | "onchain_fee_estimates": { |
| 2325 | "opening_channel_satoshis": 5265, |
| 2326 | "mutual_close_satoshis": 2523, |
| 2327 | "unilateral_close_satoshis": 4170 if anchors else 6578, |
| 2328 | "unilateral_close_nonanchor_satoshis": 6578, |
| 2329 | # These are always the non-anchor versions! |
| 2330 | "htlc_timeout_satoshis": 7293, |
| 2331 | "htlc_success_satoshis": 7733, |
| 2332 | } |
| 2333 | } |
| 2334 | |
| 2335 | l1.daemon.rpcproxy.mock_rpc('getmempoolinfo', |
| 2336 | { |
| 2337 | "mempoolminfee": 0.00010001, |
| 2338 | "minrelaytxfee": 0.00020001 |
| 2339 | }) |
| 2340 | l1.restart() |
| 2341 | assert l1.rpc.feerates('perkb') == { |
| 2342 | "perkb": { |
| 2343 | "opening": 30000, |
| 2344 | # This has increased (rounded up) |
| 2345 | "mutual_close": 20004, |
| 2346 | # This has increased (rounded up) |
| 2347 | "unilateral_anchor_close": 20004, |
| 2348 | # This has increased (rounded up) |
| 2349 | "unilateral_close": 44000, |
| 2350 | "penalty": 30000, |