mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
renepay: hack in workaround spendable reduction for release.
``` Flow 391: amount=23528000msat prob=0.000 fees=1023msat delay=140 path=-2471854x37x4/1(min=max=23528783msat)->-2414928x98x0/0-> Flow 391: Failure of 23529023msat for 2471854x37x4/1 capacity [23528783msat,23528783msat] -> [23528783msat,23528783msat] ``` We added fees and went over capacity! This screams of a deeper logic bug, but renepay is experimental and it's release day so hack around it for now... Reported-by: https://github.com/daywalker90 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
a984202576
commit
7cd4359521
1 changed files with 7 additions and 0 deletions
|
@ -321,6 +321,13 @@ bool uncertainty_network_update_from_listpeerchannels(
|
|||
scidd.dir);
|
||||
}
|
||||
|
||||
/* FIXME: There is a bug with us trying to send more down a local
|
||||
* channel (after fees) than it has capacity. For now, we reduce
|
||||
* our capacity by 1% of total, to give fee headroom. */
|
||||
if (!amount_msat_sub(&spendable, spendable,
|
||||
amount_msat_div(p->amount, 100)))
|
||||
spendable = AMOUNT_MSAT(0);
|
||||
|
||||
// TODO(eduardo): this includes pending HTLC of previous
|
||||
// payments!
|
||||
/* We know min and max liquidity exactly now! */
|
||||
|
|
Loading…
Add table
Reference in a new issue