| 73 | } |
| 74 | |
| 75 | static bool htlc_out_update_state(struct channel *channel, |
| 76 | struct htlc_out *hout, |
| 77 | enum htlc_state newstate) |
| 78 | { |
| 79 | if (!state_update_ok(channel, hout->hstate, newstate, hout->key.id, |
| 80 | "out")) |
| 81 | return false; |
| 82 | |
| 83 | bool we_filled = false; |
| 84 | wallet_htlc_update(channel->peer->ld->wallet, hout->dbid, newstate, |
| 85 | hout->preimage, |
| 86 | max_unsigned(channel->next_index[LOCAL], |
| 87 | channel->next_index[REMOTE]), |
| 88 | 0, hout->failonion, |
| 89 | hout->failmsg, &we_filled); |
| 90 | |
| 91 | hout->hstate = newstate; |
| 92 | return true; |
| 93 | } |
| 94 | |
| 95 | static struct failed_htlc *mk_failed_htlc_badonion(const tal_t *ctx, |
| 96 | const struct htlc_in *hin, |
no test coverage detected