mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
listsendpays: remove deprecated "null" amount_msat.
Changelog-Removed: `listsendpays` will no longer add `amount_msat` `null` (deprecated 0.9.1). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -129,9 +129,6 @@ void json_add_payment_fields(struct json_stream *response,
|
|||||||
if (amount_msat_greater(t->msatoshi, AMOUNT_MSAT(0)))
|
if (amount_msat_greater(t->msatoshi, AMOUNT_MSAT(0)))
|
||||||
json_add_amount_msat_compat(response, t->msatoshi, "msatoshi",
|
json_add_amount_msat_compat(response, t->msatoshi, "msatoshi",
|
||||||
"amount_msat");
|
"amount_msat");
|
||||||
else if (deprecated_apis)
|
|
||||||
json_add_null(response, "amount_msat");
|
|
||||||
|
|
||||||
|
|
||||||
json_add_amount_msat_compat(response, t->msatoshi_sent,
|
json_add_amount_msat_compat(response, t->msatoshi_sent,
|
||||||
"msatoshi_sent", "amount_sent_msat");
|
"msatoshi_sent", "amount_sent_msat");
|
||||||
|
|||||||
@@ -1722,8 +1722,7 @@ static void add_amount_sent(struct plugin *p,
|
|||||||
|
|
||||||
/* If this is an unannotated partial payment we drop out estimate for
|
/* If this is an unannotated partial payment we drop out estimate for
|
||||||
* all parts. */
|
* all parts. */
|
||||||
/* FIXME: with deprecated_apis, amount_msat can be 'null' */
|
if (msattok == NULL) {
|
||||||
if (msattok == NULL || !json_to_msat(buf, msattok, &recv)) {
|
|
||||||
mpp->amount = tal_free(mpp->amount);
|
mpp->amount = tal_free(mpp->amount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1734,6 +1733,11 @@ static void add_amount_sent(struct plugin *p,
|
|||||||
if (mpp->amount == NULL)
|
if (mpp->amount == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!json_to_msat(buf, msattok, &recv))
|
||||||
|
plugin_err(p, "Cannot convert amount_sat %.*s",
|
||||||
|
json_tok_full_len(msattok),
|
||||||
|
json_tok_full(buf, msattok));
|
||||||
|
|
||||||
if (!amount_msat_add(mpp->amount, *mpp->amount, recv))
|
if (!amount_msat_add(mpp->amount, *mpp->amount, recv))
|
||||||
plugin_log(p, LOG_BROKEN,
|
plugin_log(p, LOG_BROKEN,
|
||||||
"Cannot add amount_msat for %s: %s + %s",
|
"Cannot add amount_msat for %s: %s + %s",
|
||||||
|
|||||||
Reference in New Issue
Block a user