mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-03 22:34:21 +01:00
db: correctly migrate forwards for closed incoming channels.
We have to allow them (as otherwise `fees_collected_msat` in getinfo breaks), but it means that actually, in_htlc_id might be missing in listforwards (also, out_htlc_id might be missing, which we didn't catch before). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Fixes: #5628
This commit is contained in:
@@ -2844,7 +2844,11 @@ void json_add_forwarding_object(struct json_stream *response,
|
||||
if (payment_hash)
|
||||
json_add_sha256(response, "payment_hash", payment_hash);
|
||||
json_add_short_channel_id(response, "in_channel", &cur->channel_in);
|
||||
json_add_u64(response, "in_htlc_id", cur->htlc_id_in);
|
||||
|
||||
#ifdef COMPAT_V0121
|
||||
if (cur->htlc_id_in != HTLC_INVALID_ID)
|
||||
#endif
|
||||
json_add_u64(response, "in_htlc_id", cur->htlc_id_in);
|
||||
|
||||
/* This can be unknown if we failed before channel lookup */
|
||||
if (cur->channel_out.u64 != 0) {
|
||||
|
||||
Reference in New Issue
Block a user