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

Function costs_to_score

common/route.c:35–42  ·  view source on GitHub ↗

Squeeze total costs into a u32 */

Source from the content-addressed store, hash-verified

33
34/* Squeeze total costs into a u32 */
35static u32 costs_to_score(struct amount_msat fee,
36 struct amount_msat risk)
37{
38 u64 costs = fee.millisatoshis + risk.millisatoshis; /* Raw: score */
39 if (costs > 0xFFFFFFFF)
40 costs = 0xFFFFFFFF;
41 return costs;
42}
43
44/* Prioritize distance over costs */
45u64 route_score_shorter(struct amount_msat fee,

Callers 2

route_score_shorterFunction · 0.85
route_score_cheaperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected