Commit 43cd9b5
committed
Consider funding scopes in get_available_balances
A FundedChannel may have more than one pending FundingScope during
splicing, one for the splice attempt and one or more for any RBF
attempts. When calling get_available_balances, consider all funding
scopes and take the minimum by next_outbound_htlc_limit_msat. This is
used both informationally and to determine which channel to use to
forward an HTLC.
The choice of next_outbound_htlc_limit_msat is somewhat arbitrary but
matches the field used when determining which channel used to forward an
HTLC. Any field should do since each field should be adjusted by the
same amount relative to another FundingScope given the nature of the
fields (i.e., inbound/outbound capacity, min/max HTLC limit).
Using the minimum was chosen since an order for an HTLC to be sent over
the channel, it must be possible for each funding scope -- both the
confirmed one and any pending scopes, one of which may eventually
confirm.1 parent f972a0d commit 43cd9b5
File tree
3 files changed
+58
-14
lines changed- lightning/src/ln
3 files changed
+58
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1248 | 1258 | | |
1249 | 1259 | | |
1250 | 1260 | | |
| |||
4162 | 4172 | | |
4163 | 4173 | | |
4164 | 4174 | | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
4165 | 4189 | | |
4166 | 4190 | | |
4167 | 4191 | | |
| |||
4951 | 4975 | | |
4952 | 4976 | | |
4953 | 4977 | | |
4954 | | - | |
| 4978 | + | |
4955 | 4979 | | |
4956 | 4980 | | |
4957 | 4981 | | |
| |||
8751 | 8775 | | |
8752 | 8776 | | |
8753 | 8777 | | |
8754 | | - | |
| 8778 | + | |
8755 | 8779 | | |
8756 | 8780 | | |
8757 | 8781 | | |
| |||
8823 | 8847 | | |
8824 | 8848 | | |
8825 | 8849 | | |
| 8850 | + | |
| 8851 | + | |
| 8852 | + | |
| 8853 | + | |
| 8854 | + | |
| 8855 | + | |
| 8856 | + | |
| 8857 | + | |
| 8858 | + | |
8826 | 8859 | | |
8827 | 8860 | | |
8828 | 8861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
480 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
486 | | - | |
| 487 | + | |
487 | 488 | | |
488 | 489 | | |
489 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3744 | 3744 | | |
3745 | 3745 | | |
3746 | 3746 | | |
3747 | | - | |
3748 | | - | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
3749 | 3752 | | |
3750 | 3753 | | |
3751 | 3754 | | |
| |||
3768 | 3771 | | |
3769 | 3772 | | |
3770 | 3773 | | |
3771 | | - | |
3772 | | - | |
3773 | | - | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
3774 | 3781 | | |
3775 | 3782 | | |
3776 | 3783 | | |
| |||
3800 | 3807 | | |
3801 | 3808 | | |
3802 | 3809 | | |
3803 | | - | |
3804 | | - | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
3805 | 3815 | | |
3806 | 3816 | | |
3807 | 3817 | | |
3808 | | - | |
| 3818 | + | |
3809 | 3819 | | |
3810 | 3820 | | |
3811 | 3821 | | |
| |||
6087 | 6097 | | |
6088 | 6098 | | |
6089 | 6099 | | |
6090 | | - | |
| 6100 | + | |
6091 | 6101 | | |
6092 | 6102 | | |
6093 | 6103 | | |
| |||
0 commit comments