⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tests/test_opening.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@ def find_next_feerate(node, peer):
chan = only_one(node.rpc.listpeerchannels(peer.info['id'])['channels'])
return chan['next_feerate']

@pytest.mark.openchannel('v1')
@pytest.mark.xfail(strict=True)
@unittest.skipIf(TEST_NETWORK != 'regtest', "requires regtest")
def test_opening_with_unknown_feerates(node_factory, bitcoind):
"""
Test openchannel when feerates are unknown (like on signet/testnet with empty mempool).
"""
opts = {
'feerates': None,
'dev-no-fake-fees': True,
}

l1, l2 = node_factory.get_nodes(2, opts=[opts, {}])

# Verify fee estimation is failing only on l1
l1.daemon.wait_for_log('Unable to estimate any fees')

# Connect nodes and fund l1
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.fundwallet(10000000)

# Opening should fail due to unknown feerates
with pytest.raises(RpcError, match=r"Cannot estimate fees"):
l1.rpc.fundchannel(l2.info['id'], 1000000, minconf=0)

# Opening should work fine since fees are specified manually
l1.rpc.fundchannel(l2.info['id'], 1000000, feerate='1perkw', minconf=0)


@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@pytest.mark.openchannel('v2')
Expand Down