MCPcopy Create free account
hub / github.com/ElementsProject/lightning / _fundchannel

Function _fundchannel

tests/test_connection.py:1657–1673  ·  view source on GitHub ↗
(l1, l2, amount, close_to)

Source from the content-addressed store, hash-verified

1655 for c in l1.rpc.listpeerchannels(l2.info['id'])['channels']])
1656
1657 def _fundchannel(l1, l2, amount, close_to):
1658 l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
1659 assert(l1.rpc.listpeers()['peers'][0]['id'] == l2.info['id'])
1660
1661 # Make sure both consider any previous channels closed.
1662 wait_for(lambda: not has_normal_channels(l1, l2))
1663 wait_for(lambda: not has_normal_channels(l2, l1))
1664
1665 _, resp = l1.fundchannel(l2, amount, close_to=close_to)
1666 if close_to:
1667 assert resp['close_to']
1668 else:
1669 assert 'close_to' not in resp
1670
1671 for node in [l1, l2]:
1672 channel = node.rpc.listpeerchannels()['channels'][-1]
1673 assert amount * 1000 == channel['total_msat']
1674
1675 def _close(src, dst, addr=None):
1676 """Close the channel from src to dst, with the specified address.

Callers 1

Calls 6

wait_forFunction · 0.90
has_normal_channelsFunction · 0.85
listpeerchannelsMethod · 0.80
connectMethod · 0.45
listpeersMethod · 0.45
fundchannelMethod · 0.45

Tested by

no test coverage detected