peer_control: Don’t report removed inflights

This commit is contained in:
Dusty Daemon
2024-11-11 13:20:18 +10:30
committed by Rusty Russell
parent 5b211c0389
commit eb83ab15ae

View File

@@ -822,6 +822,7 @@ static void NON_NULL_ARGS(1, 2, 4, 5) json_add_channel(struct command *cmd,
struct amount_sat peer_funded_sats;
const struct peer_update *peer_update;
u32 feerate;
bool has_valid_inflights;
json_object_start(response, key);
json_add_node_id(response, "peer_id", &peer->id);
@@ -910,7 +911,15 @@ static void NON_NULL_ARGS(1, 2, 4, 5) json_add_channel(struct command *cmd,
json_add_txid(response, "funding_txid", &channel->funding.txid);
json_add_num(response, "funding_outnum", channel->funding.n);
has_valid_inflights = false;
if (!list_empty(&channel->inflights)) {
struct channel_inflight *inflight;
list_for_each(&channel->inflights, inflight, list)
if (!inflight->splice_locked_memonly)
has_valid_inflights = true;
}
if (has_valid_inflights) {
struct channel_inflight *initial, *inflight;
u32 last_feerate, next_feerate;
@@ -942,6 +951,8 @@ static void NON_NULL_ARGS(1, 2, 4, 5) json_add_channel(struct command *cmd,
json_array_start(response, "inflight");
list_for_each(&channel->inflights, inflight, list) {
struct bitcoin_txid txid;
if (inflight->splice_locked_memonly)
continue;
json_object_start(response, NULL);
json_add_txid(response, "funding_txid",
@@ -3214,6 +3225,8 @@ static struct command_result *json_sign_last_tx(struct command *cmd,
json_array_start(response, "inflights");
list_for_each(&channel->inflights, inflight, list) {
if (inflight->splice_locked_memonly)
continue;
tx = sign_last_tx(cmd, channel, inflight->last_tx,
&inflight->last_sig);
json_object_start(response, NULL);