mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
plugins/renepay: don't drop min to 0 if it's shown wrong, but drop 50%.
Eduardo is on holiday right now, but he pinged me asking for this. It makes some sense, and using half the *failed value* covers the case where it's less than half what we expected. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
32f5ae8d1f
commit
a984202576
1 changed files with 4 additions and 2 deletions
|
@ -220,8 +220,10 @@ void chan_extra_cannot_send(
|
|||
oldmax = ce->half[scidd->dir].known_max;
|
||||
|
||||
/* If we "knew" the capacity was at least this, we just showed we're wrong! */
|
||||
if (amount_msat_less(x, ce->half[scidd->dir].known_min))
|
||||
ce->half[scidd->dir].known_min = AMOUNT_MSAT(0);
|
||||
if (amount_msat_less(x, ce->half[scidd->dir].known_min)) {
|
||||
/* Skip to half of x, since we don't know (rounds down) */
|
||||
ce->half[scidd->dir].known_min = amount_msat_div(x, 2);
|
||||
}
|
||||
|
||||
ce->half[scidd->dir].known_max = amount_msat_min(ce->half[scidd->dir].known_max,x);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue