]> git.bitcoin.ninja Git - rust-lightning/commit
Consider HTLC in-flight count limits when assembling a route
authorMatt Corallo <git@bluematt.me>
Mon, 15 May 2023 03:34:18 +0000 (03:34 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 21 May 2023 19:05:22 +0000 (19:05 +0000)
commitb09ccd10be82a0093ae7b1b196c739fb8f32c42b
treea5b65902a5049ff82eed3a7bcac03f9e28d07fd7
parente43cfbd5f16c0c1d0a62a499dd356335e6eef4b9
Consider HTLC in-flight count limits when assembling a route

When calculating the amount available to send for the next HTLC, if
we over-count we may create routes which are not actually usable.

Historically this has been an issue, which we resolve over a few
commits.

Here we consider the number of in-flight HTLCs which we are allowed
to push towards a counterparty at once, setting the available
balance to zero if we cannot push any further HTLCs.

We also add some testing when sending to ensure that send failures
are accounted for in our balance calculations.
lightning/src/ln/channel.rs
lightning/src/ln/functional_tests.rs