diff --git a/plugins/renepay/pay.c b/plugins/renepay/pay.c index ff1172144..2c634b331 100644 --- a/plugins/renepay/pay.c +++ b/plugins/renepay/pay.c @@ -490,19 +490,9 @@ static struct command_result *try_paying(struct command *cmd, struct payment * const p = renepay->payment; plugin_log(pay_plugin->plugin,LOG_DBG,"calling %s",__PRETTY_FUNCTION__); - // TODO(eduardo): does it make sense to have this limit on attempts? - /* I am classifying the flows in attempt cycles. */ - renepay_new_attempt(renepay); - /* We try only MAX_NUM_ATTEMPTS, then we give up. */ - if ( renepay_attempt_count(renepay) > MAX_NUM_ATTEMPTS) - { - return renepay_fail(renepay, PAY_STOPPED_RETRYING, - "Reached maximum number of attempts (%d)", - MAX_NUM_ATTEMPTS); - } - struct amount_msat feebudget, fees_spent, remaining; + renepay->payment->status=PAYMENT_PENDING; if (time_after(time_now(), p->stop_time)) return renepay_fail(renepay, PAY_STOPPED_RETRYING, "Timed out"); diff --git a/plugins/renepay/pay_flow.c b/plugins/renepay/pay_flow.c index a1fed1076..91c691ab4 100644 --- a/plugins/renepay/pay_flow.c +++ b/plugins/renepay/pay_flow.c @@ -244,7 +244,6 @@ static struct pay_flow **flows_to_pay_flows(struct payment *payment, pf->amounts = tal_steal(pf, f->amounts); pf->path_dirs = tal_steal(pf, f->dirs); pf->success_prob = f->success_prob; - pf->attempt = renepay_current_attempt(payment->renepay); } tal_free(flows); diff --git a/plugins/renepay/pay_flow.h b/plugins/renepay/pay_flow.h index e519e9f7f..1a6e9b73c 100644 --- a/plugins/renepay/pay_flow.h +++ b/plugins/renepay/pay_flow.h @@ -14,9 +14,6 @@ struct pay_flow { /* So we can be an independent object for callbacks. */ struct payment * payment; - // TODO(eduardo): remove this, unnecessary - int attempt; - /* Information to link this flow to a unique sendpay. */ struct payflow_key { diff --git a/plugins/renepay/payment.c b/plugins/renepay/payment.c index 452a4caf2..de3a48af2 100644 --- a/plugins/renepay/payment.c +++ b/plugins/renepay/payment.c @@ -53,7 +53,6 @@ struct renepay * renepay_new(struct command *cmd) renepay->local_gossmods = gossmap_localmods_new(renepay); renepay->disabled = tal_arr(renepay,struct short_channel_id,0); renepay->rexmit_timer = NULL; - renepay->next_attempt=1; renepay->next_partid=1; return renepay; @@ -131,20 +130,6 @@ void payment_assert_delivering_all(const struct payment *p) } } - -int renepay_current_attempt(const struct renepay * renepay) -{ - return renepay->next_attempt-1; -} -int renepay_attempt_count(const struct renepay * renepay) -{ - return renepay->next_attempt-1; -} -void renepay_new_attempt(struct renepay * renepay) -{ - renepay->payment->status=PAYMENT_PENDING; - renepay->next_attempt++; -} struct command_result *renepay_success(struct renepay * renepay) { debug_info("calling %s",__PRETTY_FUNCTION__); diff --git a/plugins/renepay/payment.h b/plugins/renepay/payment.h index fda3ad29d..74ccabe3a 100644 --- a/plugins/renepay/payment.h +++ b/plugins/renepay/payment.h @@ -120,8 +120,6 @@ struct renepay /* Timers. */ struct plugin_timer *rexmit_timer; - /* Keep track of the number of attempts. */ - int next_attempt; /* Used in get_payflows to set ids to each pay_flow. */ u64 next_partid; }; @@ -143,11 +141,6 @@ void payment_note(struct payment *p, const char *fmt, ...); void payment_assert_delivering_incomplete(const struct payment *p); void payment_assert_delivering_all(const struct payment *p); - -int renepay_current_attempt(const struct renepay *renepay); -int renepay_attempt_count(const struct renepay *renepay); -void renepay_new_attempt(struct renepay *renepay); - struct command_result *renepay_success(struct renepay *renepay); struct command_result *renepay_fail(