Commit ad315bc
committed
Honor the per-peer fee policy at the skim site
The forwarding skim now reads the peer's granted policy from the SCID store
instead of hard-coding Flat(Standard). A peer with no grant resolves to
Standard, so the skim is byte-for-byte the historical 2% for everyone the
issuer set has not waived. This is the read side that makes the persisted
grant actually take effect; before it, a verified ZeroFee was stored and
then ignored.
The lookup is hoisted out of the per-HTLC loop because the policy is keyed
by peer, not by HTLC, so it is one store read per batch rather than one per
forward.
A zero skim is now two distinct cases, so the log is split. ZeroFee is the
expected path and logs at info. Any other tier skimming nothing means the
fee would have consumed the whole HTLC, which keeps the error-level log:
a forward of the full amount that we expected to take a cut on. Previously
ZeroFee was unreachable, so the single error log was correct; now that a
grant can legitimately waive the fee, the error would be noise.1 parent 95c6c0b commit ad315bc
1 file changed
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
785 | 793 | | |
786 | 794 | | |
787 | 795 | | |
| |||
792 | 800 | | |
793 | 801 | | |
794 | 802 | | |
795 | | - | |
| 803 | + | |
796 | 804 | | |
797 | 805 | | |
798 | 806 | | |
799 | 807 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
807 | 823 | | |
808 | 824 | | |
809 | 825 | | |
| |||
0 commit comments