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

Function flow_fee

plugins/renepay/flow.c:374–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374bool flow_fee(struct amount_msat *ret, struct flow *flow)
375{
376 assert(ret);
377 assert(flow);
378 struct amount_msat fee;
379 struct amount_msat spend;
380 if (!flow_spend(&spend, flow))
381 goto function_fail;
382 if (!amount_msat_sub(&fee, spend, flow->amount))
383 goto function_fail;
384
385 *ret = fee;
386 return true;
387
388function_fail:
389 return false;
390}
391
392bool flowset_fee(struct amount_msat *ret, struct flow **flows)
393{

Callers 5

fmt_flowsFunction · 0.70
flowset_feeFunction · 0.70
print_flowsFunction · 0.50
print_flowsFunction · 0.50
print_flowsFunction · 0.50

Calls 2

amount_msat_subFunction · 0.85
flow_spendFunction · 0.70

Tested by 3

print_flowsFunction · 0.40
print_flowsFunction · 0.40
print_flowsFunction · 0.40