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

Function attempt_fee

plugins/xpay/xpay.c:1292–1302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1290}
1291
1292static struct amount_msat attempt_fee(const struct attempt *attempt)
1293{
1294 const size_t len = tal_count(attempt->hops);
1295 if (len == 0)
1296 return AMOUNT_MSAT(0);
1297 struct amount_msat fee;
1298 if (!amount_msat_sub(&fee, attempt->hops[0].amount_in,
1299 attempt->hops[len - 1].amount_out))
1300 abort();
1301 return fee;
1302}
1303
1304static struct amount_msat total_fees_being_sent(const struct payment *payment)
1305{

Callers 1

total_fees_being_sentFunction · 0.85

Calls 2

amount_msat_subFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected