| 2127 | } |
| 2128 | |
| 2129 | static bool update_in_htlc(struct channel *channel, |
| 2130 | u64 id, enum htlc_state newstate) |
| 2131 | { |
| 2132 | struct htlc_in *hin; |
| 2133 | struct lightningd *ld = channel->peer->ld; |
| 2134 | |
| 2135 | hin = find_htlc_in(ld->htlcs_in, channel, id); |
| 2136 | if (!hin) { |
| 2137 | channel_internal_error(channel, "Can't find in HTLC %"PRIu64, id); |
| 2138 | return false; |
| 2139 | } |
| 2140 | |
| 2141 | if (!htlc_in_update_state(channel, hin, newstate)) |
| 2142 | return false; |
| 2143 | |
| 2144 | htlc_in_check(hin, __func__); |
| 2145 | if (newstate == SENT_REMOVE_ACK_REVOCATION) |
| 2146 | remove_htlc_in(channel, hin); |
| 2147 | |
| 2148 | return true; |
| 2149 | } |
| 2150 | |
| 2151 | static bool update_out_htlc(struct channel *channel, |
| 2152 | u64 id, enum htlc_state newstate) |
no test coverage detected