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:
Rusty Russell
2021-01-29 10:30:09 +10:30
parent 9eeb290637
commit 406eb37717
2 changed files with 6 additions and 5 deletions

View File

@@ -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",