| 55 | } |
| 56 | |
| 57 | static bool htlc_in_update_state(struct channel *channel, |
| 58 | struct htlc_in *hin, |
| 59 | enum htlc_state newstate) |
| 60 | { |
| 61 | if (!state_update_ok(channel, hin->hstate, newstate, hin->key.id, "in")) |
| 62 | return false; |
| 63 | |
| 64 | wallet_htlc_update(channel->peer->ld->wallet, |
| 65 | hin->dbid, newstate, hin->preimage, |
| 66 | max_unsigned(channel->next_index[LOCAL], |
| 67 | channel->next_index[REMOTE]), |
| 68 | hin->badonion, hin->failonion, NULL, |
| 69 | hin->we_filled); |
| 70 | |
| 71 | hin->hstate = newstate; |
| 72 | return true; |
| 73 | } |
| 74 | |
| 75 | static bool htlc_out_update_state(struct channel *channel, |
| 76 | struct htlc_out *hout, |
no test coverage detected