X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPayer.java;h=8cefcd05599d3a8a8aeace480ef7a9474b95547e;hb=890e35a4387758c0447aab34166caa579bbf3a08;hp=9b0375fbb1be45fed0c5110bac7a056ca11b29a8;hpb=47341beaeecf907f422f126500baf586d54a0d41;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Payer.java b/src/main/java/org/ldk/structs/Payer.java index 9b0375fb..8cefcd05 100644 --- a/src/main/java/org/ldk/structs/Payer.java +++ b/src/main/java/org/ldk/structs/Payer.java @@ -116,7 +116,7 @@ public class Payer extends CommonBase { for (int q = 0; q < ret_conv_16_len; q++) { long ret_conv_16 = ret[q]; org.ldk.structs.ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, ret_conv_16); } - ret_conv_16_hu_conv.ptrs_to.add(this); + if (ret_conv_16_hu_conv != null) { ret_conv_16_hu_conv.ptrs_to.add(this); }; ret_conv_16_arr[q] = ret_conv_16_hu_conv; } return ret_conv_16_arr; @@ -128,14 +128,14 @@ public class Payer extends CommonBase { * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) { - long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); + long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(payment_secret); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); - this.ptrs_to.add(route); + if (this != null) { this.ptrs_to.add(route); }; return ret_hu_conv; } @@ -143,13 +143,13 @@ public class Payer extends CommonBase { * Sends a spontaneous payment over the Lightning Network using the given [`Route`]. */ public Result_PaymentIdPaymentSendFailureZ send_spontaneous_payment(Route route, byte[] payment_preimage) { - long ret = bindings.Payer_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_preimage, 32)); + long ret = bindings.Payer_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); Reference.reachabilityFence(payment_preimage); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); - this.ptrs_to.add(route); + if (this != null) { this.ptrs_to.add(route); }; return ret_hu_conv; } @@ -157,13 +157,13 @@ public class Payer extends CommonBase { * Retries a failed payment path for the [`PaymentId`] using the given [`Route`]. */ public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) { - long ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32)); + long ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); - this.ptrs_to.add(route); + if (this != null) { this.ptrs_to.add(route); }; return ret_hu_conv; }