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)
| 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) |
no test coverage detected