mirror of
https://github.com/ACINQ/eclair.git
synced 2024-11-20 02:27:32 +01:00
ba4cca29e5
* Use channel capacity and balance in path-finding The path finding algorithm uses channel capacity instead of htlcMaximumMsat. It also takes into account channel balance when available and excludes channels that don't have enough funds to relay the payment. This change also fixes an off-by-one error in weight computation: we were incorrectly applying a channel's fee to the amount that needs to be relayed through that channel (whereas this is instead what the node needs to receive to collect enough fee *before* relaying). * Refactor Graph file Add documentation, update comments, rename fields and reformat to (helpfully) make the code clearer. * Simplify path-fiding implementation There were a couple confusing steps in the implementation of Yen's algorithm. The first one was the computation of the `edgesToIgnore` and the specific handling of the case i = 0. This specific case wasn't needed and made the code a bit hard to read. The second one was the weight provided to dijkstra for spur paths. The weight of the root path was applied to the target node. It was probably an attempt to take into account the fact that dijkstra wasn't computing a complete path and that fees may not match, but it couldn't really work. I removed that and added a fee check at the end of the path-finding. * Update graph balance for duplicate channel_update This case regularly happens after a restart: the router already has the latest channel_update for that channel, but we want to update the graph's balances because they are all at `None` after a restart. |
||
---|---|---|
.. | ||
src | ||
eclair-cli | ||
pom.xml |