htlcswitch: thread through packet's inbound wire records
For calculating the available auxiliary bandwidth of a channel, we need access to the inbound custom wire records of the HTLC packet, which might contain auxiliary information about the worth of the HTLC packet apart from the BTC value being transported.
This commit is contained in:
5 files changed
+55
-48
No files matched your search
@@ -917,6 +917,7 @@ func (s *Switch) getLocalLink(pkt *htlcPacket, htlc *lnwire.UpdateAddHTLC) (
|
||||
currentHeight := atomic.LoadUint32(&s.bestHeight)
|
||||
htlcErr := link.CheckHtlcTransit(
|
||||
htlc.PaymentHash, htlc.Amount, htlc.Expiry, currentHeight,
|
||||
htlc.CustomRecords,
|
||||
)
|
||||
if htlcErr != nil {
|
||||
log.Errorf("Link %v policy for local forward not "+
|
||||
@@ -2887,10 +2888,9 @@ func (s *Switch) handlePacketAdd(packet *htlcPacket,
|
||||
failure = link.CheckHtlcForward(
|
||||
htlc.PaymentHash, packet.incomingAmount,
|
||||
packet.amount, packet.incomingTimeout,
|
||||
packet.outgoingTimeout,
|
||||
packet.inboundFee,
|
||||
currentHeight,
|
||||
packet.originalOutgoingChanID,
|
||||
packet.outgoingTimeout, packet.inboundFee,
|
||||
currentHeight, packet.originalOutgoingChanID,
|
||||
htlc.CustomRecords,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user