Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use channel balance in path-finding #1395

Merged
merged 7 commits into from May 11, 2020
Merged

Use channel balance in path-finding #1395

merged 7 commits into from May 11, 2020

Commits on Apr 27, 2020

  1. 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).
    t-bast committed Apr 27, 2020
    Copy the full SHA
    54af0b3 View commit details
    Browse the repository at this point in the history
  2. Refactor Graph file

    Add documentation, update comments, rename fields and reformat to (helpfully)
    make the code clearer.
    
    There is no functional change in this commit, this is just cosmetic.
    Functional changes and bug fixes will come in next commits.
    t-bast committed Apr 27, 2020
    Copy the full SHA
    9d655c5 View commit details
    Browse the repository at this point in the history
  3. 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.
    t-bast committed Apr 27, 2020
    Copy the full SHA
    da73e81 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2020

  1. Copy the full SHA
    702493f View commit details
    Browse the repository at this point in the history

Commits on May 6, 2020

  1. 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.
    t-bast committed May 6, 2020
    Copy the full SHA
    27db557 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2020

  1. Copy the full SHA
    1d0bb60 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    272359b View commit details
    Browse the repository at this point in the history