X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=ts%2Fstructs%2FRoutingMessageHandler.ts;fp=ts%2Fstructs%2FRoutingMessageHandler.ts;h=307db61cc7109dd7a85fe66710a58fc63fa230c9;hb=f6c75b182a7786062a4966e8939701ef59092509;hp=28c867d073290cf19d0ecb451858ef6d231887a6;hpb=9da1fb892048ce2faddd35e930619fd1a16c0137;p=ldk-java diff --git a/ts/structs/RoutingMessageHandler.ts b/ts/structs/RoutingMessageHandler.ts index 28c867d0..307db61c 100644 --- a/ts/structs/RoutingMessageHandler.ts +++ b/ts/structs/RoutingMessageHandler.ts @@ -55,9 +55,8 @@ import * as bindings from '../bindings' // TODO: figure out location }, get_next_channel_announcements (starting_point: number, batch_amount: number): number[] { - ThreeTuple[] ret = arg.get_next_channel_announcements(starting_point, batch_amount); - result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(ret_conv_63.a == null ? 0 : ret_conv_63.a.ptr & ~1, ret_conv_63.b == null ? 0 : ret_conv_63.b.ptr & ~1, ret_conv_63.c == null ? 0 : ret_conv_63.c.ptr & ~1)).toArray(number[]::new) : null; - for (ThreeTuple ret_conv_63: ret) { impl_holder.held.ptrs_to.add(ret_conv_63.a); impl_holder.held.ptrs_to.add(ret_conv_63.b); impl_holder.held.ptrs_to.add(ret_conv_63.c); }; + ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] ret = arg.get_next_channel_announcements(starting_point, batch_amount); + result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_59 -> ret_conv_59 != null ? ret_conv_59.ptr : 0).toArray(number[]::new) : null; return result; }, @@ -115,7 +114,7 @@ import * as bindings from '../bindings' // TODO: figure out location handle_node_announcement(msg: NodeAnnouncement): Result_boolLightningErrorZ; handle_channel_announcement(msg: ChannelAnnouncement): Result_boolLightningErrorZ; handle_channel_update(msg: ChannelUpdate): Result_boolLightningErrorZ; - get_next_channel_announcements(starting_point: number, batch_amount: number): ThreeTuple[]; + get_next_channel_announcements(starting_point: number, batch_amount: number): ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[]; get_next_node_announcements(starting_point: Uint8Array, batch_amount: number): NodeAnnouncement[]; sync_routing_table(their_node_id: Uint8Array, init: Init): void; handle_reply_channel_range(their_node_id: Uint8Array, msg: ReplyChannelRange): Result_NoneLightningErrorZ; @@ -149,29 +148,16 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } - public ThreeTuple[] get_next_channel_announcements(number starting_point, number batch_amount) { + public ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] get_next_channel_announcements(number starting_point, number batch_amount) { number[] ret = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount); - ThreeTuple[] ret_conv_63_arr = new ThreeTuple[ret.length]; - for (int l = 0; l < ret.length; l++) { - number ret_conv_63 = ret[l]; - number ret_conv_63_a = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(ret_conv_63); - const ret_conv_63_a_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret_conv_63_a); - ret_conv_63_a_hu_conv.ptrs_to.add(this);; - number ret_conv_63_b = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(ret_conv_63); - const ret_conv_63_b_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret_conv_63_b); - ret_conv_63_b_hu_conv.ptrs_to.add(this);; - number ret_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(ret_conv_63); - const ret_conv_63_c_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret_conv_63_c); - ret_conv_63_c_hu_conv.ptrs_to.add(this);; - ThreeTuple ret_conv_63_conv = new ThreeTuple(ret_conv_63_a_hu_conv, ret_conv_63_b_hu_conv, ret_conv_63_c_hu_conv, () -> { - bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(ret_conv_63); - }); - ret_conv_63_a_hu_conv.ptrs_to.add(ret_conv_63_conv); - ret_conv_63_b_hu_conv.ptrs_to.add(ret_conv_63_conv); - ret_conv_63_c_hu_conv.ptrs_to.add(ret_conv_63_conv); - ret_conv_63_arr[l] = ret_conv_63_conv; + ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] ret_conv_59_arr = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[ret.length]; + for (int h = 0; h < ret.length; h++) { + number ret_conv_59 = ret[h]; + ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret_conv_59); + ret_conv_59_hu_conv.ptrs_to.add(this); + ret_conv_59_arr[h] = ret_conv_59_hu_conv; } - return ret_conv_63_arr; + return ret_conv_59_arr; } public NodeAnnouncement[] get_next_node_announcements(Uint8Array starting_point, number batch_amount) {