mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-18 13:52:02 +01:00
htlcswitch: also set packet amount on modified forward
This fixes an issue where the switch's forwarding logic would think the bandwidth to forward an HTLC was insufficient for a custom channel HTLC, because we only overwrote the HTLC's amount and not the packet's (which is just a short cut struct member anyway).
This commit is contained in:
parent
374b659476
commit
4f2c75f620
@ -658,6 +658,7 @@ func (f *interceptedForward) ResumeModified(
|
||||
switch htlc := f.packet.htlc.(type) {
|
||||
case *lnwire.UpdateAddHTLC:
|
||||
outgoingAmountMsat.WhenSome(func(amount lnwire.MilliSatoshi) {
|
||||
f.packet.amount = amount
|
||||
htlc.Amount = amount
|
||||
})
|
||||
|
||||
|
@ -407,7 +407,7 @@ func testForwardInterceptorModifiedHtlc(ht *lntest.HarnessTest) {
|
||||
customRecords[crKey] = crValue
|
||||
|
||||
action := routerrpc.ResolveHoldForwardAction_RESUME_MODIFIED
|
||||
newOutgoingAmountMsat := packet.OutgoingAmountMsat + 4000
|
||||
newOutgoingAmountMsat := packet.OutgoingAmountMsat
|
||||
|
||||
err := bobInterceptor.Send(&routerrpc.ForwardHtlcInterceptResponse{
|
||||
IncomingCircuitKey: packet.IncomingCircuitKey,
|
||||
|
Loading…
x
Reference in New Issue
Block a user