htlcswitch: add receiver-side inbound fee support

This commit is contained in:
Joost Jager committed 2024-03-31 16:49:19 +02:00
1 parent 3e6adbf1c0
commit e8c97deaef
10 files changed
+388 -19

No files matched your search

+14
View File
@@ -961,12 +961,26 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
// routing policy into a forwarding policy.
var forwardingPolicy *models.ForwardingPolicy
if selfPolicy != nil {
var inboundWireFee lnwire.Fee
_, err := selfPolicy.ExtraOpaqueData.ExtractRecords(
&inboundWireFee,
)
if err != nil {
return nil, err
}
inboundFee := models.NewInboundFeeFromWire(
inboundWireFee,
)
forwardingPolicy = &models.ForwardingPolicy{
MinHTLCOut: selfPolicy.MinHTLC,
MaxHTLC: selfPolicy.MaxHTLC,
BaseFee: selfPolicy.FeeBaseMSat,
FeeRate: selfPolicy.FeeProportionalMillionths,
TimeLockDelta: uint32(selfPolicy.TimeLockDelta),
InboundFee: inboundFee,
}
} else {
p.log.Warnf("Unable to find our forwarding policy "+