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;
* 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;
}
* 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;
}
* 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;
}