| 577 | } |
| 578 | |
| 579 | static void subtract_offered_htlcs(const struct channel *channel, |
| 580 | struct amount_msat *amount) |
| 581 | { |
| 582 | const struct htlc_out *hout; |
| 583 | struct htlc_out_map_iter outi; |
| 584 | struct lightningd *ld = channel->peer->ld; |
| 585 | |
| 586 | for (hout = htlc_out_map_first(&ld->htlcs_out, &outi); |
| 587 | hout; |
| 588 | hout = htlc_out_map_next(&ld->htlcs_out, &outi)) { |
| 589 | if (hout->key.channel != channel) |
| 590 | continue; |
| 591 | if (!amount_msat_sub(amount, *amount, hout->msat)) |
| 592 | *amount = AMOUNT_MSAT(0); |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | static void subtract_received_htlcs(const struct channel *channel, |
| 597 | struct amount_msat *amount) |
no test coverage detected