(node_factory)
| 440 | @pytest.mark.openchannel('v1') |
| 441 | @pytest.mark.openchannel('v2') |
| 442 | def test_disconnect_opener(node_factory): |
| 443 | # Now error on opener side during channel open. |
| 444 | disconnects = ['-WIRE_OPEN_CHANNEL', |
| 445 | '+WIRE_OPEN_CHANNEL', |
| 446 | '-WIRE_FUNDING_CREATED'] |
| 447 | if EXPERIMENTAL_DUAL_FUND: |
| 448 | disconnects = ['-WIRE_OPEN_CHANNEL2', |
| 449 | '+WIRE_OPEN_CHANNEL2', |
| 450 | '-WIRE_TX_ADD_INPUT', |
| 451 | '+WIRE_TX_ADD_INPUT', |
| 452 | '-WIRE_TX_ADD_OUTPUT', |
| 453 | '+WIRE_TX_ADD_OUTPUT', |
| 454 | '-WIRE_TX_COMPLETE', |
| 455 | '+WIRE_TX_COMPLETE'] |
| 456 | |
| 457 | l1 = node_factory.get_node(disconnect=disconnects) |
| 458 | l2 = node_factory.get_node(may_reconnect=EXPERIMENTAL_DUAL_FUND) |
| 459 | |
| 460 | l1.fundwallet(2000000) |
| 461 | |
| 462 | for d in disconnects: |
| 463 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 464 | with pytest.raises(RpcError): |
| 465 | l1.rpc.fundchannel(l2.info['id'], 25000) |
| 466 | # First peer valishes, but later it just disconnects |
| 467 | wait_for(lambda: all([p['connected'] is False for p in l1.rpc.listpeers()['peers']])) |
| 468 | |
| 469 | # This one will succeed. |
| 470 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 471 | l1.rpc.fundchannel(l2.info['id'], 25000) |
| 472 | |
| 473 | # Should still only have one peer! |
| 474 | assert len(l1.rpc.listpeers()['peers']) == 1 |
| 475 | assert len(l2.rpc.listpeers()['peers']) == 1 |
| 476 | |
| 477 | |
| 478 | def test_remote_disconnect(node_factory): |
nothing calls this directly
no test coverage detected