]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Update demo C++ bindings example for new bindings
authorMatt Corallo <git@bluematt.me>
Sun, 7 Feb 2021 05:58:49 +0000 (00:58 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 18 Feb 2021 17:28:25 +0000 (12:28 -0500)
lightning-c-bindings/demo.cpp

index 37bb8d3188d53cbc22dfb323dd2e12567fb2fa2c..32c8d605c119bbafb2a0137644a6de5f9b0bae39 100644 (file)
@@ -385,8 +385,9 @@ int main() {
                assert(channels2->datalen == 0);
 
                LDK::RoutingMessageHandler net_msgs2 = NetGraphMsgHandler_as_RoutingMessageHandler(&net_graph2);
-               LDK::ChannelAnnouncement chan_ann = ChannelAnnouncement_read(LDKu8slice { .data = valid_node_announcement, .datalen = sizeof(valid_node_announcement) });
-               LDK::CResult_boolLightningErrorZ ann_res = net_msgs2->handle_channel_announcement(net_msgs2->this_arg, &chan_ann);
+               LDK::CResult_ChannelAnnouncementDecodeErrorZ chan_ann = ChannelAnnouncement_read(LDKu8slice { .data = valid_node_announcement, .datalen = sizeof(valid_node_announcement) });
+               assert(chan_ann->result_ok);
+               LDK::CResult_boolLightningErrorZ ann_res = net_msgs2->handle_channel_announcement(net_msgs2->this_arg, chan_ann->contents.result);
                assert(ann_res->result_ok);
 
                LDK::MessageHandler msg_handler2 = MessageHandler_new(ChannelManager_as_ChannelMessageHandler(&cm2), std::move(net_msgs2));