From: Matt Corallo Date: Mon, 4 Apr 2022 16:25:33 +0000 (+0000) Subject: Use `_none()` constructor instead of setting tag in C++ demo X-Git-Tag: v0.0.106.0^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=0097a4856a3c3c970adb76f7472805cbac62e4ef;p=ldk-c-bindings Use `_none()` constructor instead of setting tag in C++ demo --- diff --git a/lightning-c-bindings/demo.cpp b/lightning-c-bindings/demo.cpp index ec7a0d1..fa75140 100644 --- a/lightning-c-bindings/demo.cpp +++ b/lightning-c-bindings/demo.cpp @@ -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);