| 2057 | } |
| 2058 | |
| 2059 | static bool update_in_htlc(struct channel *channel, |
| 2060 | u64 id, enum htlc_state newstate) |
| 2061 | { |
| 2062 | struct htlc_in *hin; |
| 2063 | struct lightningd *ld = channel->peer->ld; |
| 2064 | |
| 2065 | hin = find_htlc_in(ld->htlcs_in, channel, id); |
| 2066 | if (!hin) { |
| 2067 | channel_internal_error(channel, "Can't find in HTLC %"PRIu64, id); |
| 2068 | return false; |
| 2069 | } |
| 2070 | |
| 2071 | if (!htlc_in_update_state(channel, hin, newstate)) |
| 2072 | return false; |
| 2073 | |
| 2074 | htlc_in_check(hin, __func__); |
| 2075 | if (newstate == SENT_REMOVE_ACK_REVOCATION) |
| 2076 | remove_htlc_in(channel, hin); |
| 2077 | |
| 2078 | return true; |
| 2079 | } |
| 2080 | |
| 2081 | static bool update_out_htlc(struct channel *channel, |
| 2082 | u64 id, enum htlc_state newstate) |
no test coverage detected