plugins/pay: fix unnecessary code.

1. p is a child of cmd, so it's freed by command_failed.
2. cltv_budget is set a few lines up to the same thing already.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-02-26 11:20:33 +10:30
parent 2a6d3cad01
commit a901402e66

View File

@@ -2476,12 +2476,10 @@ static struct command_result *json_paymod(struct command *cmd,
if (!amount_msat_fee(&p->constraints.fee_budget, p->amount, 0, if (!amount_msat_fee(&p->constraints.fee_budget, p->amount, 0,
*maxfee_pct_millionths / 100)) { *maxfee_pct_millionths / 100)) {
tal_free(p);
return command_fail( return command_fail(
cmd, JSONRPC2_INVALID_PARAMS, cmd, JSONRPC2_INVALID_PARAMS,
"Overflow when computing fee budget, fee rate too high."); "Overflow when computing fee budget, fee rate too high.");
} }
p->constraints.cltv_budget = *maxdelay;
payment_mod_exemptfee_get_data(p)->amount = *exemptfee; payment_mod_exemptfee_get_data(p)->amount = *exemptfee;
shadow_route = payment_mod_shadowroute_get_data(p); shadow_route = payment_mod_shadowroute_get_data(p);