mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-04 03:03:51 +01:00
renepay: reduce minimum "known" if it proves incorrect.
There's a fascinating bug report which suggests this happens on local channels, implying spendable_msat is wrong? See-also: #6567 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
40bb22b9ed
commit
685c413b61
1 changed files with 9 additions and 1 deletions
|
@ -178,7 +178,15 @@ void chan_extra_cannot_send(
|
|||
x = AMOUNT_MSAT(0);
|
||||
}
|
||||
|
||||
ce->half[dir].known_min = amount_msat_min(ce->half[dir].known_min,x);
|
||||
/* If we "knew" the capacity was at least this, we just showed we're wrong! */
|
||||
if (amount_msat_less_eq(x, ce->half[dir].known_min)) {
|
||||
debug_paynote(p, "Expected scid=%s, dir=%d min %s, but %s failed! Setting min to 0",
|
||||
type_to_string(tmpctx,struct short_channel_id,&scid),
|
||||
dir,
|
||||
type_to_string(tmpctx,struct amount_msat,&ce->half[dir].known_min),
|
||||
type_to_string(tmpctx,struct amount_msat,&x));
|
||||
ce->half[dir].known_min = AMOUNT_MSAT(0);
|
||||
}
|
||||
ce->half[dir].known_max = amount_msat_min(ce->half[dir].known_max,x);
|
||||
|
||||
debug_paynote(p,"Update chan knowledge scid=%s, dir=%d: [%s,%s]",
|
||||
|
|
Loading…
Add table
Reference in a new issue