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

Function json_add_amount_sats_deprecated

common/json_stream.c:602–615  ·  view source on GitHub ↗

When I noticed that we were adding "XXXmsat" fields *not* ending in _msat */

Source from the content-addressed store, hash-verified

600
601/* When I noticed that we were adding "XXXmsat" fields *not* ending in _msat */
602void json_add_amount_sats_deprecated(struct json_stream *result,
603 const char *fieldname,
604 const char *msatfieldname,
605 struct amount_sat sat)
606{
607 if (deprecated_apis) {
608 struct amount_msat msat;
609 assert(!strends(fieldname, "_msat"));
610 if (amount_sat_to_msat(&msat, sat))
611 json_add_string(result, fieldname,
612 take(fmt_amount_msat(NULL, msat)));
613 }
614 json_add_amount_sat_msat(result, msatfieldname, sat);
615}
616
617void json_add_sats(struct json_stream *result,
618 const char *fieldname,

Calls 5

strendsFunction · 0.85
fmt_amount_msatFunction · 0.85
amount_sat_to_msatFunction · 0.70
json_add_stringFunction · 0.70
json_add_amount_sat_msatFunction · 0.70

Tested by

no test coverage detected