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

Function _fundchannel

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

Source from the content-addressed store, hash-verified

1662 for c in l1.rpc.listpeerchannels(l2.info['id'])['channels']])
1663
1664 def _fundchannel(l1, l2, amount, close_to):
1665 l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
1666 assert(l1.rpc.listpeers()['peers'][0]['id'] == l2.info['id'])
1667
1668 # Make sure both consider any previous channels closed.
1669 wait_for(lambda: not has_normal_channels(l1, l2))
1670 wait_for(lambda: not has_normal_channels(l2, l1))
1671
1672 _, resp = l1.fundchannel(l2, amount, close_to=close_to)
1673 if close_to:
1674 assert resp['close_to']
1675 else:
1676 assert 'close_to' not in resp
1677
1678 for node in [l1, l2]:
1679 channel = node.rpc.listpeerchannels()['channels'][-1]
1680 assert amount * 1000 == channel['total_msat']
1681
1682 def _close(src, dst, addr=None):
1683 """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