| 1802 | } |
| 1803 | |
| 1804 | static bool update_in_htlc(struct channel *channel, |
| 1805 | u64 id, enum htlc_state newstate) |
| 1806 | { |
| 1807 | struct htlc_in *hin; |
| 1808 | struct lightningd *ld = channel->peer->ld; |
| 1809 | |
| 1810 | hin = find_htlc_in(&ld->htlcs_in, channel, id); |
| 1811 | if (!hin) { |
| 1812 | channel_internal_error(channel, "Can't find in HTLC %"PRIu64, id); |
| 1813 | return false; |
| 1814 | } |
| 1815 | |
| 1816 | if (!htlc_in_update_state(channel, hin, newstate)) |
| 1817 | return false; |
| 1818 | |
| 1819 | htlc_in_check(hin, __func__); |
| 1820 | if (newstate == SENT_REMOVE_ACK_REVOCATION) |
| 1821 | remove_htlc_in(channel, hin); |
| 1822 | |
| 1823 | return true; |
| 1824 | } |
| 1825 | |
| 1826 | static bool update_out_htlc(struct channel *channel, |
| 1827 | u64 id, enum htlc_state newstate) |
no test coverage detected