Use `_none()` constructor instead of setting tag in C++ demo
authorMatt Corallo <git@bluematt.me>
Mon, 4 Apr 2022 16:25:33 +0000 (16:25 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 4 Apr 2022 18:16:31 +0000 (18:16 +0000)
lightning-c-bindings/demo.cpp

index ec7a0d104e2a2dcb6ac5fd2ca70a40fc12d4f81a..fa75140a59e9be8c53bc48034513e6f63977e10b 100644 (file)
@@ -331,12 +331,9 @@ public:
                t2 = std::thread(&sock_read_data_thread, pipefds_1_to_2[0], &sock2, &net2);
 
                // Note that we have to bind the result to a C++ class to make sure it gets free'd
-               LDKCOption_NetAddressZ remote_network_address = {
-                       .tag = LDKCOption_NetAddressZ_None,
-               };
-               LDK::CResult_CVec_u8ZPeerHandleErrorZ con_res = PeerManager_new_outbound_connection(&net1, ChannelManager_get_our_node_id(&cm2), sock1, remote_network_address);
+               LDK::CResult_CVec_u8ZPeerHandleErrorZ con_res = PeerManager_new_outbound_connection(&net1, ChannelManager_get_our_node_id(&cm2), sock1, COption_NetAddressZ_none());
                assert(con_res->result_ok);
-               LDK::CResult_NonePeerHandleErrorZ con_res2 = PeerManager_new_inbound_connection(&net2, sock2, remote_network_address);
+               LDK::CResult_NonePeerHandleErrorZ con_res2 = PeerManager_new_inbound_connection(&net2, sock2, COption_NetAddressZ_none());
                assert(con_res2->result_ok);
 
                auto writelen = write(pipefds_1_to_2[1], con_res->contents.result->data, con_res->contents.result->datalen);