Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / Event.java
index 6733a54b27f93f1dd3455f007b044335c2b86cfb..3a62005b2cb4e2d1912302c86deae49bc4e08801 100644 (file)
@@ -253,7 +253,7 @@ public class Event extends CommonBase {
         */
        public Event clone() {
                long ret = bindings.Event_clone(this.ptr);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -264,7 +264,7 @@ public class Event extends CommonBase {
         */
        public static Event funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) {
                long ret = bindings.Event_funding_generation_ready(temporary_channel_id, channel_value_satoshis, output_script, user_channel_id);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -275,7 +275,7 @@ public class Event extends CommonBase {
         */
        public static Event payment_received(byte[] payment_hash, long amt, PaymentPurpose purpose) {
                long ret = bindings.Event_payment_received(payment_hash, amt, purpose.ptr);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -286,7 +286,7 @@ public class Event extends CommonBase {
         */
        public static Event payment_sent(byte[] payment_preimage) {
                long ret = bindings.Event_payment_sent(payment_preimage);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -297,7 +297,7 @@ public class Event extends CommonBase {
         */
        public static Event payment_path_failed(byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path) {
                long ret = bindings.Event_payment_path_failed(payment_hash, rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -308,7 +308,7 @@ public class Event extends CommonBase {
         */
        public static Event pending_htlcs_forwardable(long time_forwardable) {
                long ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -319,7 +319,7 @@ public class Event extends CommonBase {
         */
        public static Event spendable_outputs(SpendableOutputDescriptor[] outputs) {
                long ret = bindings.Event_spendable_outputs(outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_27 -> outputs_conv_27.ptr).toArray() : null);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -330,7 +330,7 @@ public class Event extends CommonBase {
         */
        public static Event payment_forwarded(Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx) {
                long ret = bindings.Event_payment_forwarded(fee_earned_msat.ptr, claim_from_onchain_tx);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -341,7 +341,7 @@ public class Event extends CommonBase {
         */
        public static Event channel_closed(byte[] channel_id, ClosureReason reason) {
                long ret = bindings.Event_channel_closed(channel_id, reason.ptr);
-               if (ret < 1024) { return null; }
+               if (ret >= 0 && ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;