(node_factory)
| 538 | @pytest.mark.openchannel('v1') |
| 539 | @pytest.mark.openchannel('v2') |
| 540 | def test_disconnect_fundee(node_factory): |
| 541 | # Now error on fundee side during channel open. |
| 542 | disconnects = ['-WIRE_ACCEPT_CHANNEL', |
| 543 | '+WIRE_ACCEPT_CHANNEL'] |
| 544 | if EXPERIMENTAL_DUAL_FUND: |
| 545 | disconnects = ['-WIRE_ACCEPT_CHANNEL2', |
| 546 | '+WIRE_ACCEPT_CHANNEL2', |
| 547 | '-WIRE_TX_COMPLETE', |
| 548 | '+WIRE_TX_COMPLETE'] |
| 549 | |
| 550 | l1 = node_factory.get_node() |
| 551 | l2 = node_factory.get_node(disconnect=disconnects) |
| 552 | |
| 553 | l1.fundwallet(2000000) |
| 554 | |
| 555 | for d in disconnects: |
| 556 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 557 | with pytest.raises(RpcError): |
| 558 | l1.rpc.fundchannel(l2.info['id'], CHANNEL_SIZE) |
| 559 | # First peer valishes, but later it just disconnects |
| 560 | wait_for(lambda: all([p['connected'] is False for p in l1.rpc.listpeers()['peers']])) |
| 561 | |
| 562 | # This one will succeed. |
| 563 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 564 | l1.rpc.fundchannel(l2.info['id'], CHANNEL_SIZE) |
| 565 | |
| 566 | # Should still only have one peer! |
| 567 | assert len(l1.rpc.listpeers()) == 1 |
| 568 | assert len(l2.rpc.listpeers()) == 1 |
| 569 | |
| 570 | |
| 571 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
nothing calls this directly
no test coverage detected