(node_factory, bitcoind)
| 4396 | |
| 4397 | |
| 4398 | def test_closing_tx_valid(node_factory, bitcoind): |
| 4399 | l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True, |
| 4400 | 'dev-no-reconnect': None}) |
| 4401 | |
| 4402 | # First, mutual close. |
| 4403 | close = l1.rpc.close(l2.info['id']) |
| 4404 | |
| 4405 | wait_for(lambda: len(bitcoind.rpc.getrawmempool()) == 1) |
| 4406 | assert only_one(bitcoind.rpc.getrawmempool()) == only_one(close['txids']) |
| 4407 | assert bitcoind.rpc.getrawtransaction(only_one(close['txids'])) == only_one(close['txs']) |
| 4408 | bitcoind.generate_block(1) |
| 4409 | # Change output and the closed channel output. |
| 4410 | wait_for(lambda: [o['status'] for o in l1.rpc.listfunds()['outputs']] == ['confirmed'] * 2) |
| 4411 | |
| 4412 | # Now, unilateral close. |
| 4413 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 4414 | l1.rpc.fundchannel(l2.info['id'], 10**6) |
| 4415 | bitcoind.generate_block(1, wait_for_mempool=1) |
| 4416 | |
| 4417 | l1.rpc.disconnect(l2.info['id'], force=True) |
| 4418 | close = l1.rpc.close(l2.info['id'], 1) |
| 4419 | |
| 4420 | wait_for(lambda: len(bitcoind.rpc.getrawmempool()) == 1) |
| 4421 | assert only_one(bitcoind.rpc.getrawmempool()) == only_one(close['txids']) |
| 4422 | assert bitcoind.rpc.getrawtransaction(only_one(close['txids'])) == only_one(close['txs']) |
| 4423 | |
| 4424 | |
| 4425 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd does not provide feerates on regtest') |
nothing calls this directly
no test coverage detected