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

Function amount_sat_scale

common/amount.c:349–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349WARN_UNUSED_RESULT bool amount_sat_scale(struct amount_sat *val,
350 struct amount_sat sat,
351 double scale)
352{
353 double scaled = sat.satoshis * scale;
354
355 /* If mantissa is < 64 bits, a naive "if (scaled >
356 * UINT64_MAX)" doesn't work. Stick to powers of 2. */
357 if (scaled >= (double)((u64)1 << 63) * 2)
358 return false;
359 val->satoshis = scaled;
360 return true;
361}
362
363bool amount_sat_eq(struct amount_sat a, struct amount_sat b)
364{

Callers 2

lease_rates_calc_feeFunction · 0.85
apply_policyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected