| 662 | } |
| 663 | |
| 664 | enum renepay_errorcode |
| 665 | chan_extra_commit_htlc(struct chan_extra_map *chan_extra_map, |
| 666 | const struct short_channel_id_dir *scidd, |
| 667 | struct amount_msat amount) |
| 668 | { |
| 669 | struct chan_extra_half *h = |
| 670 | get_chan_extra_half_by_scid(chan_extra_map, scidd); |
| 671 | if (!h) |
| 672 | return RENEPAY_CHANNEL_NOT_FOUND; |
| 673 | if (!amount_msat_accumulate(&h->htlc_total, amount)) |
| 674 | return RENEPAY_AMOUNT_OVERFLOW; |
| 675 | h->num_htlcs++; |
| 676 | return RENEPAY_NOERROR; |
| 677 | } |
no test coverage detected