X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FEvent.java;h=163c7a97d689f9b90c6c160608cb2f8ebbfed270;hb=1347a5b4a7688ea4f3e69d6c10a08d57328fa344;hp=bbba62d7b8c4917a99e5e479836243fd49278619;hpb=0ddbeb5d1cddaa1d89cad2a63548434b2e1e227a;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index bbba62d7..163c7a97 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * An Event which you should probably take some action in response to. + * + * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use + * them directly as they don't round-trip exactly (for example FundingGenerationReady is never + * written as it makes no sense to respond to it after reconnecting to peers). + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Event extends CommonBase { private Event(Object _dummy, long ptr) { super(ptr); } @@ -59,6 +67,7 @@ public class Event extends CommonBase { super(null, ptr); long funding_txo = obj.funding_txo; OutPoint funding_txo_hu_conv = new OutPoint(null, funding_txo); + funding_txo_hu_conv.ptrs_to.add(this); this.funding_txo = funding_txo_hu_conv; this.user_channel_id = obj.user_channel_id; } @@ -102,14 +111,14 @@ public class Event extends CommonBase { private SpendableOutputs(long ptr, bindings.LDKEvent.SpendableOutputs obj) { super(null, ptr); long[] outputs = obj.outputs; - SpendableOutputDescriptor[] arr_conv_27_arr = new SpendableOutputDescriptor[outputs.length]; + SpendableOutputDescriptor[] outputs_conv_27_arr = new SpendableOutputDescriptor[outputs.length]; for (int b = 0; b < outputs.length; b++) { - long arr_conv_27 = outputs[b]; - SpendableOutputDescriptor arr_conv_27_hu_conv = SpendableOutputDescriptor.constr_from_ptr(arr_conv_27); - arr_conv_27_hu_conv.ptrs_to.add(this); - arr_conv_27_arr[b] = arr_conv_27_hu_conv; + long outputs_conv_27 = outputs[b]; + SpendableOutputDescriptor outputs_conv_27_hu_conv = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27); + outputs_conv_27_hu_conv.ptrs_to.add(this); + outputs_conv_27_arr[b] = outputs_conv_27_hu_conv; } - this.outputs = arr_conv_27_arr; + this.outputs = outputs_conv_27_arr; } } }