Commit Graph

13 Commits

Author SHA1 Message Date
Michael Schmoock
45fe611d44 jitrebalance: fix cli upstream changes on listpeerchannels 2023-02-08 15:32:42 +01:00
Michael Schmoock
be112f7b39 jitrebalance: fix upstream changes 2022-12-29 14:37:05 +01:00
Michael Schmoock
424770449a jitrebalance: fix missing payment_secret for sendpay 2021-07-23 17:04:14 +02:00
Rusty Russell
87c9f56f75 jitrebalance: fix test for latest c-lightning which required payment_secret
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-23 22:03:27 +09:30
Michael Schmoock
258c0e647a jitrebalance: fix flake8 nits 2020-12-13 15:36:15 +01:00
Antoine Poinsot
4fb91a6f45 jitrebalance: test failure cases
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-06-02 11:59:12 +02:00
Antoine Poinsot
c5c24cb74a jitrebalance: assert l2 jit-rebalanced in test_simple_rebalance
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-06-02 11:59:12 +02:00
Antoine Poinsot
e239fcdcc1 jitrebalance: test_issue_88 needs DEVELOPER too
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-06-02 11:59:12 +02:00
Christian Decker
d34cb6e637 jitrebalance: Do not attempt to access scid on unconfirmed channels
Fixes #88
2020-05-27 12:34:57 +02:00
Christian Decker
18d03962df jitrebalance: Add a test to reproduce issue #88
I'm expecting it to be because we access the short_channel_id
indiscriminately, which is unsafe if the channel is not confirmed yet, i.e.,
it doesn't have a scid yet.
2020-05-27 12:34:57 +02:00
Christian Decker
504d15bfbf jitrebalance: Refactor code and implement retry logic 2020-01-07 21:21:11 +01:00
Christian Decker
9ef45ae83c jitrebalance: Skip tests if not developer, gossip is too slow 2020-01-07 21:21:11 +01:00
Christian Decker
c453e8982f jitrebalance: First version of the JITrebalance plugin
A simple implementation of a jit-rebalance plugin based in the idea of
@renepickhardt. Upon receiving an HTLC that we are supposed to forward check
whether the channel has sufficient capacity to forward. If that's not the case
we need to rebalance. For this we compute a circular route through some other
nodes, returning funds on the edge we are supposed to use when
forwarding. This means we rebalance the channel just enough to make forwarding
possible.

This only implements the simple version, without FOAF advertisements of free
rebalancings, but it already works rather nicely.

Suggested-by: Rene Pickhardt <@renepickhardt>
Signed-off-by: Christian Decker <@cdecker>
2020-01-07 21:21:11 +01:00