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

Function _close

tests/test_connection.py:1682–1696  ·  view source on GitHub ↗

Close the channel from src to dst, with the specified address. Returns the address of the outputs in the close tx. Raises an error if some expectations are not met.

(src, dst, addr=None)

Source from the content-addressed store, hash-verified

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.
1684
1685 Returns the address of the outputs in the close tx. Raises an
1686 error if some expectations are not met.
1687
1688 """
1689 r = l1.rpc.close(l2.info['id'], destination=addr)
1690 assert r['type'] == 'mutual'
1691 tx = bitcoind.rpc.decoderawtransaction(only_one(r['txs']))
1692
1693 addrs = [scriptpubkey_addr(vout['scriptPubKey']) for vout in tx['vout']]
1694 bitcoind.generate_block(1, wait_for_mempool=[only_one(r['txids'])])
1695 sync_blockheight(bitcoind, [l1, l2])
1696 return addrs
1697
1698 # check that normal peer close works
1699 _fundchannel(l1, l2, amt_normal, None)

Callers 1

Calls 5

only_oneFunction · 0.90
scriptpubkey_addrFunction · 0.90
sync_blockheightFunction · 0.90
generate_blockMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected