mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +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:
parent
9eeb290637
commit
406eb37717
@ -129,9 +129,6 @@ void json_add_payment_fields(struct json_stream *response,
|
||||
if (amount_msat_greater(t->msatoshi, AMOUNT_MSAT(0)))
|
||||
json_add_amount_msat_compat(response, t->msatoshi, "msatoshi",
|
||||
"amount_msat");
|
||||
else if (deprecated_apis)
|
||||
json_add_null(response, "amount_msat");
|
||||
|
||||
|
||||
json_add_amount_msat_compat(response, t->msatoshi_sent,
|
||||
"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
|
||||
* all parts. */
|
||||
/* FIXME: with deprecated_apis, amount_msat can be 'null' */
|
||||
if (msattok == NULL || !json_to_msat(buf, msattok, &recv)) {
|
||||
if (msattok == NULL) {
|
||||
mpp->amount = tal_free(mpp->amount);
|
||||
return;
|
||||
}
|
||||
@ -1734,6 +1733,11 @@ static void add_amount_sent(struct plugin *p,
|
||||
if (mpp->amount == NULL)
|
||||
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))
|
||||
plugin_log(p, LOG_BROKEN,
|
||||
"Cannot add amount_msat for %s: %s + %s",
|
||||
|
Loading…
Reference in New Issue
Block a user