| 2083 | } |
| 2084 | |
| 2085 | static bool update_in_htlc(struct channel *channel, |
| 2086 | u64 id, enum htlc_state newstate) |
| 2087 | { |
| 2088 | struct htlc_in *hin; |
| 2089 | struct lightningd *ld = channel->peer->ld; |
| 2090 | |
| 2091 | hin = find_htlc_in(ld->htlcs_in, channel, id); |
| 2092 | if (!hin) { |
| 2093 | channel_internal_error(channel, "Can't find in HTLC %"PRIu64, id); |
| 2094 | return false; |
| 2095 | } |
| 2096 | |
| 2097 | if (!htlc_in_update_state(channel, hin, newstate)) |
| 2098 | return false; |
| 2099 | |
| 2100 | htlc_in_check(hin, __func__); |
| 2101 | if (newstate == SENT_REMOVE_ACK_REVOCATION) |
| 2102 | remove_htlc_in(channel, hin); |
| 2103 | |
| 2104 | return true; |
| 2105 | } |
| 2106 | |
| 2107 | static bool update_out_htlc(struct channel *channel, |
| 2108 | u64 id, enum htlc_state newstate) |
no test coverage detected