lightningd: don't put old deprecated local_msat and remote_msat in listpeerchannels.

These were deprecated in v0.12.0, hence scheduled for removal next version anyway
(use local_fund_msat and remote_funds_msat).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-02-09 11:06:35 +10:30
committed by Alex Myers
parent b7ab80963d
commit 49b3459be5
3 changed files with 4 additions and 15 deletions

View File

@@ -862,7 +862,8 @@ static void json_add_channel(struct lightningd *ld,
json_object_start(response, "funding");
if (deprecated_apis) {
/* We don't put v0.12-deprecated fields into listpeerchannels */
if (deprecated_apis && !peer) {
json_add_sat_only(response, "local_msat", channel->our_funds);
json_add_sat_only(response, "remote_msat", peer_funded_sats);
json_add_amount_msat_only(response, "pushed_msat", channel->push);
@@ -921,7 +922,7 @@ static void json_add_channel(struct lightningd *ld,
channel->our_funds);
json_add_sat_only(response, "remote_funds_msat",
peer_funded_sats);
if (!deprecated_apis)
if (!deprecated_apis || peer)
json_add_amount_msat_only(response, "pushed_msat",
channel->push);
}