MCPcopy Create free account
hub / github.com/ElementsProject/lightning / exemptfee_cb

Function exemptfee_cb

plugins/libplugin-pay.c:3226–3242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3224}
3225
3226static struct command_result *exemptfee_cb(struct exemptfee_data *d, struct payment *p)
3227{
3228 if (p->step != PAYMENT_STEP_INITIALIZED || p->parent != NULL)
3229 return payment_continue(p);
3230
3231 if (amount_msat_greater_eq(d->amount, p->constraints.fee_budget)) {
3232 paymod_log(
3233 p, LOG_INFORM,
3234 "Payment fee constraint %s is below exemption threshold, "
3235 "allowing a maximum fee of %s",
3236 fmt_amount_msat(tmpctx, p->constraints.fee_budget),
3237 fmt_amount_msat(tmpctx, d->amount));
3238 p->constraints.fee_budget = d->amount;
3239 p->start_constraints->fee_budget = d->amount;
3240 }
3241 return payment_continue(p);
3242}
3243
3244REGISTER_PAYMENT_MODIFIER(exemptfee, struct exemptfee_data *,
3245 exemptfee_data_init, exemptfee_cb);

Callers

nothing calls this directly

Calls 4

amount_msat_greater_eqFunction · 0.85
paymod_logFunction · 0.85
payment_continueFunction · 0.70
fmt_amount_msatFunction · 0.50

Tested by

no test coverage detected