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
39 changes: 39 additions & 0 deletions tests/test_opening.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,45 @@ def find_next_feerate(node, peer):
chan = only_one(node.rpc.listpeerchannels(peer.info['id'])['channels'])
return chan['next_feerate']

@pytest.mark.openchannel('v2')
@unittest.skipIf(TEST_NETWORK != 'regtest', "requires regtest")
def test_opening_dualfund_with_unknown_feerates(node_factory, bitcoind):
"""
Test dualfund openchannel when feerates are unknown (like on signet/testnet with empty mempool).
"""
opts = {
'ignore-fee-limits': True,
'feerates': None,
'dev-no-fake-fees': True,
'experimental-dual-fund': None
}

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

l1.fundwallet(FUNDAMOUNT)

# Connect peers
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)

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

# Open channel l1 <-> l2
fund_tx = l1.rpc.fundchannel(l2.info['id'], 100000, feerate='253perkw', minconf=0)['txid']

# Verify mempool is not empty
mempool = bitcoind.rpc.getrawmempool()
assert fund_tx in mempool and len(mempool) == 1

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

# Mine blocks to confirm channels
bitcoind.generate_block(1, wait_for_mempool=1)

l2.rpc.listpeerchannels(l1.info['id'])['channels']

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