plugins/libplugin-pay.c: Add new payee_incoming_limit to limit number of HTLCs based on payee connectivity.

Fixes: #3926

(probably)

Changelog-Fixed: pay: Also limit the number of splits if the payee seems to have a low number of channels that can enter it, given the max-concurrent-htlcs limit.
This commit is contained in:
ZmnSCPxj jxPCSnmZ
2020-08-14 10:54:31 +08:00
committed by Rusty Russell
parent deced56344
commit 0eb1e7e0ca
4 changed files with 114 additions and 8 deletions

View File

@@ -1915,9 +1915,10 @@ struct payment_modifier *paymod_mods[] = {
&exemptfee_pay_mod,
&directpay_pay_mod,
&shadowroute_pay_mod,
/* NOTE: The order in which these two paymods are executed is
/* NOTE: The order in which these three paymods are executed is
* significant!
* routehints *must* execute first before presplit.
* routehints *must* execute first before payee_incoming_limit
* which *must* execute bfore presplit.
*
* FIXME: Giving an ordered list of paymods to the paymod
* system is the wrong interface, given that the order in
@@ -1932,6 +1933,7 @@ struct payment_modifier *paymod_mods[] = {
* use.
*/
&routehints_pay_mod,
&payee_incoming_limit_pay_mod,
&presplit_pay_mod,
&waitblockheight_pay_mod,
&retry_pay_mod,