(l1, l2, amount, close_to)
| 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. |
no test coverage detected