rgb-cln/channeld
Matt Whitlock 6324980484 channeld: do not enforce max_accepted_htlcs on LOCAL in channel reinit
If a channel goes offline while the count of outstanding outgoing HTLCs
exceeds the limit that we enforce against the peer, then the channel
could never be brought online again because `add_htlc` called by
`channel_force_htlcs` in `channeld/full_channel.c` would return
`CHANNEL_ERR_TOO_MANY_HTLCS`. The protocol specification actually does
allow us to exceed the limits that we are enforcing against the peer;
we are only prohibited from exceeding the limits that the peer is
enforcing against us. `add_htlc` takes an `enforce_aggregate_limits`
parameter that appears to have been intended for `channel_force_htlcs`
to exempt the local node from obeying the limits that it is enforcing
against the peer, but this parameter was only being respected for the
total HTLC value-in-flight check but not for the HTLC count check. This
commit respects the parameter for the HTLC count check as well and
resolves the problem of "Could not restore HTLCs".

Fixes: #5636
Changelog-Fixed: channeld: Channel reinitialization no longer fails when the number of outstanding outgoing HTLCs exceeds `max_accepted_htlcs`.
2022-09-28 14:00:20 +02:00
..
test memleak: simplify API. 2022-09-19 11:34:42 +09:30
Makefile channeld: take over gossip_rcvd_filter.c and is_msg_gossip_broadcast. 2022-06-17 14:14:02 +09:30
channeld.c channeld: send error, not warning, if peer has old commitment number. 2022-09-26 11:36:09 +02:00
channeld.h channeld: simply exit if hsmd vanishes. 2022-02-08 11:15:52 +10:30
channeld_htlc.h htlcs: add flag to 'fail immediately' 2021-10-23 12:59:13 +02:00
channeld_wire.csv gossipd: set no_forward bit on channel_update for private channels. 2022-09-24 15:22:27 +09:30
commit_tx.c Remove general shadowed variables. 2022-08-31 12:18:28 +03:00
commit_tx.h dusty-htlcs: enforce limit on dusty htlcs 2021-10-23 12:59:13 +02:00
full_channel.c channeld: do not enforce max_accepted_htlcs on LOCAL in channel reinit 2022-09-28 14:00:20 +02:00
full_channel.h dusty-htlcs: enforce limit on dusty htlcs 2021-10-23 12:59:13 +02:00
full_channel_error.h dusty-htlcs: enforce limit on dusty htlcs 2021-10-23 12:59:13 +02:00
watchtower.c hsmd: Add wallet index metadata to existing messages 2022-03-10 10:22:29 +10:30
watchtower.h hsmd: Add wallet index metadata to existing messages 2022-03-10 10:22:29 +10:30