Skip to content

Commit 7cd4359

Browse files
committed
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 <[email protected]>
1 parent a984202 commit 7cd4359

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/renepay/uncertainty_network.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@ bool uncertainty_network_update_from_listpeerchannels(
321321
scidd.dir);
322322
}
323323

324+
/* FIXME: There is a bug with us trying to send more down a local
325+
* channel (after fees) than it has capacity. For now, we reduce
326+
* our capacity by 1% of total, to give fee headroom. */
327+
if (!amount_msat_sub(&spendable, spendable,
328+
amount_msat_div(p->amount, 100)))
329+
spendable = AMOUNT_MSAT(0);
330+
324331
// TODO(eduardo): this includes pending HTLC of previous
325332
// payments!
326333
/* We know min and max liquidity exactly now! */

0 commit comments

Comments
 (0)