Return `FEE_INSUFFICIENT` before checking balance for incoming low-fee HTLCs
Change Description
Incoming HTLCs with lower-than-advertised fees are rejected before checking if the channel balance is sufficient to route the payment. This helps to prevent channel probing.
Fixes #5721.
Steps to Test
Undoing the changes in link.go (basically moving the call to canSendHtlc above if incomingHtlcAmt < amtToForward || actualFee < expectedFee ...) should cause the new test in link_test.go to fail.
I updated the release notes to 0.16.0!
Hmmm that's strange, I feel like that test could be related to this change. I'll dig into that a bit and see what I can find.
Circling back to this... I took a look at that test, but I wasn't able to get it to fail using make unit pkg=htlcswitch. @carlaKC could you show me how/where it's failing? I did rebase recently, so maybe that fixed it if it was an unrelated failure.
could you show me how/where it's failing?
It was failing in the last build when I reviewed (I think CI / run unit tests (btcd unit-cover), but don't remember). Everything green now, so it's probably an unrelated flake.
!lightninglabs-deploy mute 2023-Feb-01
@tvolk131, remember to re-request review from reviewers when ready
!lightninglabs-deploy mute 2023-Mar-01
@tvolk131, remember to re-request review from reviewers when ready
Replaced by #7490