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.
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>