- public Result_NonePaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) {
- long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret);
- if (ret >= 0 && ret < 1024) { return null; }
+ public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) {
+ long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Retries a payment along the given [`Route`].
+ *
+ * Errors returned are a superset of those returned from [`send_payment`], so see
+ * [`send_payment`] documentation for more details on errors. This method will also error if the
+ * retry amount puts the payment more than 10% over the payment's total amount, if the payment
+ * for the given `payment_id` cannot be found (likely due to timeout or success), or if
+ * further retries have been disabled with [`abandon_payment`].
+ *
+ * [`send_payment`]: [`ChannelManager::send_payment`]
+ * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
+ */
+ public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) {
+ long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(route);
+ Reference.reachabilityFence(payment_id);
+ if (ret >= 0 && ret <= 4096) { return null; }