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

Function exemptfee_cb

plugins/libplugin-pay.c:2949–2965  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2947}
2948
2949static void exemptfee_cb(struct exemptfee_data *d, struct payment *p)
2950{
2951 if (p->step != PAYMENT_STEP_INITIALIZED || p->parent != NULL)
2952 return payment_continue(p);
2953
2954 if (amount_msat_greater_eq(d->amount, p->constraints.fee_budget)) {
2955 paymod_log(
2956 p, LOG_INFORM,
2957 "Payment fee constraint %s is below exemption threshold, "
2958 "allowing a maximum fee of %s",
2959 type_to_string(tmpctx, struct amount_msat, &p->constraints.fee_budget),
2960 type_to_string(tmpctx, struct amount_msat, &d->amount));
2961 p->constraints.fee_budget = d->amount;
2962 p->start_constraints->fee_budget = d->amount;
2963 }
2964 return payment_continue(p);
2965}
2966
2967REGISTER_PAYMENT_MODIFIER(exemptfee, struct exemptfee_data *,
2968 exemptfee_data_init, exemptfee_cb);

Callers

nothing calls this directly

Calls 4

payment_continueFunction · 0.85
amount_msat_greater_eqFunction · 0.85
paymod_logFunction · 0.85
type_to_stringClass · 0.50

Tested by

no test coverage detected