mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
Makefile: check for direct amount_sat/amount_msat access.
We need to do it in various places, but we shouldn't do it lightly: the primitives are there to help us get overflow handling correct. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -335,7 +335,7 @@ void json_add_amount_msat(struct json_stream *result,
|
||||
const char *rawfieldname,
|
||||
const char *msatfieldname)
|
||||
{
|
||||
json_add_u64(result, rawfieldname, msat.millisatoshis);
|
||||
json_add_u64(result, rawfieldname, msat.millisatoshis); /* Raw: low-level helper */
|
||||
json_add_member(result, msatfieldname, "\"%s\"",
|
||||
type_to_string(tmpctx, struct amount_msat, &msat));
|
||||
}
|
||||
@@ -346,7 +346,7 @@ void json_add_amount_sat(struct json_stream *result,
|
||||
const char *msatfieldname)
|
||||
{
|
||||
struct amount_msat msat;
|
||||
json_add_u64(result, rawfieldname, sat.satoshis);
|
||||
json_add_u64(result, rawfieldname, sat.satoshis); /* Raw: low-level helper */
|
||||
if (amount_sat_to_msat(&msat, sat))
|
||||
json_add_member(result, msatfieldname, "\"%s\"",
|
||||
type_to_string(tmpctx, struct amount_msat, &msat));
|
||||
|
||||
Reference in New Issue
Block a user