Skip to content

Commit 93e562f

Browse files
committed
[bindings] Update C++ demo for new NetGraphMsgHandler::new() params
1 parent 30a42f4 commit 93e562f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lightning-c-bindings/demo.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ const LDKThirtyTwoBytes payment_hash_1 = {
9898
}
9999
};
100100

101+
const LDKThirtyTwoBytes genesis_hash = { // We don't care particularly if this is "right"
102+
.data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1 }
103+
};
104+
101105
void print_log(const void *this_arg, const char *record) {
102106
printf("%p - %s\n", this_arg, record);
103107
}
@@ -264,7 +268,7 @@ int main() {
264268
LDK::CVec_ChannelDetailsZ channels = ChannelManager_list_channels(&cm1);
265269
assert(channels->datalen == 0);
266270

267-
LDK::NetGraphMsgHandler net_graph1 = NetGraphMsgHandler_new(NULL, logger1);
271+
LDK::NetGraphMsgHandler net_graph1 = NetGraphMsgHandler_new(genesis_hash, NULL, logger1);
268272

269273
LDK::MessageHandler msg_handler1 = MessageHandler_new(ChannelManager_as_ChannelMessageHandler(&cm1), NetGraphMsgHandler_as_RoutingMessageHandler(&net_graph1));
270274

@@ -310,7 +314,7 @@ int main() {
310314
LDK::CVec_ChannelDetailsZ channels2 = ChannelManager_list_channels(&cm2);
311315
assert(channels2->datalen == 0);
312316

313-
LDK::NetGraphMsgHandler net_graph2 = NetGraphMsgHandler_new(NULL, logger2);
317+
LDK::NetGraphMsgHandler net_graph2 = NetGraphMsgHandler_new(genesis_hash, NULL, logger2);
314318
LDK::RoutingMessageHandler net_msgs2 = NetGraphMsgHandler_as_RoutingMessageHandler(&net_graph2);
315319
LDK::ChannelAnnouncement chan_ann = ChannelAnnouncement_read(LDKu8slice { .data = valid_node_announcement, .datalen = sizeof(valid_node_announcement) });
316320
LDK::CResult_boolLightningErrorZ ann_res = net_msgs2->handle_channel_announcement(net_msgs2->this_arg, &chan_ann);

0 commit comments

Comments
 (0)