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

Function _close

tests/test_connection.py:1675–1689  ·  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

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