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