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

Function risk_price

common/dijkstra.c:110–120  ·  view source on GitHub ↗

We price in risk as riskfactor percent per year. */

Source from the content-addressed store, hash-verified

108
109/* We price in risk as riskfactor percent per year. */
110static struct amount_msat risk_price(struct amount_msat amount,
111 u32 riskfactor, u32 cltv_delay)
112{
113 struct amount_msat riskfee;
114
115 if (!amount_msat_scale(&riskfee, amount,
116 riskfactor / 100.0 / BLOCKS_PER_YEAR
117 * cltv_delay))
118 return AMOUNT_MSAT(-1ULL);
119 return riskfee;
120}
121
122/* Do Dijkstra: start in this case is the dst node. */
123const struct dijkstra *

Callers 1

dijkstra_Function · 0.85

Calls 1

amount_msat_scaleFunction · 0.85

Tested by

no test coverage detected