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

Function _close

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

1618 assert amount * 1000 == channel['total_msat']
1619
1620 def _close(src, dst, addr=None):
1621 """Close the channel from src to dst, with the specified address.
1622
1623 Returns the address of the outputs in the close tx. Raises an
1624 error if some expectations are not met.
1625
1626 """
1627 r = l1.rpc.close(l2.info['id'], destination=addr)
1628 assert r['type'] == 'mutual'
1629 tx = bitcoind.rpc.decoderawtransaction(r['tx'])
1630
1631 addrs = [scriptpubkey_addr(vout['scriptPubKey']) for vout in tx['vout']]
1632 bitcoind.generate_block(1, wait_for_mempool=[r['txid']])
1633 sync_blockheight(bitcoind, [l1, l2])
1634 return addrs
1635
1636 # check that normal peer close works
1637 _fundchannel(l1, l2, amt_normal, None)

Callers 1

Calls 4

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

Tested by

no test coverage detected