* Creates an invoice payer that retries failed payment paths.
*
* Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
- * `retry_attempts` has been exceeded for a given [`Invoice`].
+ * `retry` has been exceeded for a given [`Invoice`].
*/
- public static InvoicePayer of(Payer payer, Router router, MultiThreadedLockableScore scorer, Logger logger, EventHandler event_handler, RetryAttempts retry_attempts) {
- long ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, scorer == null ? 0 : scorer.ptr & ~1, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry_attempts == null ? 0 : retry_attempts.ptr & ~1);
+ public static InvoicePayer of(Payer payer, Router router, MultiThreadedLockableScore scorer, Logger logger, EventHandler event_handler, Retry retry) {
+ long ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, scorer == null ? 0 : scorer.ptr, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry.ptr);
Reference.reachabilityFence(payer);
Reference.reachabilityFence(router);
Reference.reachabilityFence(scorer);
Reference.reachabilityFence(logger);
Reference.reachabilityFence(event_handler);
- Reference.reachabilityFence(retry_attempts);
+ Reference.reachabilityFence(retry);
if (ret >= 0 && ret <= 4096) { return null; }
- InvoicePayer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoicePayer(null, ret); }
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- ret_hu_conv.ptrs_to.add(payer);
- ret_hu_conv.ptrs_to.add(router);
- ret_hu_conv.ptrs_to.add(scorer);
- ret_hu_conv.ptrs_to.add(logger);
- ret_hu_conv.ptrs_to.add(event_handler);
+ org.ldk.structs.InvoicePayer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoicePayer(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payer); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(router); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(event_handler); };
return ret_hu_conv;
}
* for you.
*/
public Result_PaymentIdPaymentErrorZ pay_invoice(Invoice invoice) {
- long ret = bindings.InvoicePayer_pay_invoice(this.ptr, invoice == null ? 0 : invoice.ptr & ~1);
+ long ret = bindings.InvoicePayer_pay_invoice(this.ptr, invoice == null ? 0 : invoice.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(invoice);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
- this.ptrs_to.add(invoice);
+ if (this != null) { this.ptrs_to.add(invoice); };
return ret_hu_conv;
}
* for you.
*/
public Result_PaymentIdPaymentErrorZ pay_zero_value_invoice(Invoice invoice, long amount_msats) {
- long ret = bindings.InvoicePayer_pay_zero_value_invoice(this.ptr, invoice == null ? 0 : invoice.ptr & ~1, amount_msats);
+ long ret = bindings.InvoicePayer_pay_zero_value_invoice(this.ptr, invoice == null ? 0 : invoice.ptr, amount_msats);
Reference.reachabilityFence(this);
Reference.reachabilityFence(invoice);
Reference.reachabilityFence(amount_msats);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
- this.ptrs_to.add(invoice);
+ if (this != null) { this.ptrs_to.add(invoice); };
return ret_hu_conv;
}
Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
EventHandler ret_hu_conv = new EventHandler(null, ret);
- ret_hu_conv.ptrs_to.add(this);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
return ret_hu_conv;
}