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

Function risk_price

common/dijkstra.c:111–121  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 2

dijkstra_Function · 0.85
mainFunction · 0.85

Calls 1

amount_msat_scaleFunction · 0.85

Tested by 1

mainFunction · 0.68