mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-08 00:24:28 +01:00
common/amount: make fmt_amount_sat / fmt_amount_msat etc take copy.
We pass by copy everywhere else, let's do it here too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
23af9d4972
commit
2de467274e
@@ -295,7 +295,7 @@ static struct command_result *listoffers_done(struct command *cmd,
|
||||
/* We could allow invoices for less, I suppose. */
|
||||
if (!amount_msat_eq(expected, amt))
|
||||
return fail_inv(cmd, inv, "Expected invoice for %s",
|
||||
fmt_amount_msat(tmpctx, &expected));
|
||||
fmt_amount_msat(tmpctx, expected));
|
||||
}
|
||||
|
||||
plugin_log(cmd->plugin, LOG_INFORM,
|
||||
|
||||
@@ -1767,10 +1767,10 @@ static void add_new_entry(struct json_stream *ret,
|
||||
* failures. */
|
||||
if (pm->amount != NULL && pm->num_nonfailed_parts > 0)
|
||||
json_add_string(ret, "amount_msat",
|
||||
fmt_amount_msat(tmpctx, pm->amount));
|
||||
fmt_amount_msat(tmpctx, *pm->amount));
|
||||
|
||||
json_add_string(ret, "amount_sent_msat",
|
||||
fmt_amount_msat(tmpctx, &pm->amount_sent));
|
||||
fmt_amount_msat(tmpctx, pm->amount_sent));
|
||||
|
||||
if (pm->num_nonfailed_parts > 1)
|
||||
json_add_u64(ret, "number_of_parts",
|
||||
|
||||
@@ -1050,7 +1050,7 @@ fundchannel_start_dest(struct multifundchannel_destination *dest)
|
||||
json_add_node_id(req->js, "id", &dest->id);
|
||||
assert(!dest->all);
|
||||
json_add_string(req->js, "amount",
|
||||
fmt_amount_sat(tmpctx, &dest->amount));
|
||||
fmt_amount_sat(tmpctx, dest->amount));
|
||||
|
||||
if (mfc->cmtmt_feerate_str)
|
||||
json_add_string(req->js, "feerate", mfc->cmtmt_feerate_str);
|
||||
@@ -1058,7 +1058,7 @@ fundchannel_start_dest(struct multifundchannel_destination *dest)
|
||||
json_add_string(req->js, "feerate", mfc->feerate_str);
|
||||
json_add_bool(req->js, "announce", dest->announce);
|
||||
json_add_string(req->js, "push_msat",
|
||||
fmt_amount_msat(tmpctx, &dest->push_msat));
|
||||
fmt_amount_msat(tmpctx, dest->push_msat));
|
||||
if (dest->close_to_str)
|
||||
json_add_string(req->js, "close_to", dest->close_to_str);
|
||||
|
||||
|
||||
@@ -1014,7 +1014,7 @@ openchannel_init_dest(struct multifundchannel_destination *dest)
|
||||
json_add_node_id(req->js, "id", &dest->id);
|
||||
assert(!dest->all);
|
||||
json_add_string(req->js, "amount",
|
||||
fmt_amount_sat(tmpctx, &dest->amount));
|
||||
fmt_amount_sat(tmpctx, dest->amount));
|
||||
|
||||
/* Copy the original parent down */
|
||||
tal_wally_start();
|
||||
|
||||
Reference in New Issue
Block a user