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

Function payment_fees

plugins/renepay/payment.c:170–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170struct amount_msat payment_fees(const struct payment *p)
171{
172 assert(p);
173 struct amount_msat fees;
174 struct amount_msat sent = payment_sent(p),
175 delivered = payment_delivered(p);
176
177 if (!amount_msat_sub(&fees, sent, delivered))
178 plugin_err(
179 pay_plugin->plugin,
180 "Strange, sent amount (%s) is less than delivered (%s), "
181 "aborting.",
182 fmt_amount_msat(tmpctx, sent),
183 fmt_amount_msat(tmpctx, delivered));
184 return fees;
185}
186
187u64 payment_parts(const struct payment *payment)
188{

Callers

nothing calls this directly

Calls 5

payment_sentFunction · 0.85
payment_deliveredFunction · 0.85
amount_msat_subFunction · 0.85
plugin_errFunction · 0.50
fmt_amount_msatFunction · 0.50

Tested by

no test coverage detected