Skip to content

Commit b411b41

Browse files
committed
htlcswitch: remove a context.TODO
1 parent 1e5c11f commit b411b41

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

htlcswitch/mailbox.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ type mailBoxConfig struct {
109109

110110
// failMailboxUpdate is used to fail an expired HTLC and use the
111111
// correct SCID if the underlying channel uses aliases.
112-
failMailboxUpdate func(outScid,
112+
failMailboxUpdate func(ctx context.Context, outScid,
113113
mailboxScid lnwire.ShortChannelID) lnwire.FailureMessage
114114
}
115115

@@ -707,7 +707,7 @@ func (m *memoryMailBox) FailAdd(pkt *htlcPacket) {
707707
// peer if this is a forward, or report to the user if the failed
708708
// payment was locally initiated.
709709
failure := m.cfg.failMailboxUpdate(
710-
pkt.originalOutgoingChanID, m.cfg.shortChanID,
710+
ctx, pkt.originalOutgoingChanID, m.cfg.shortChanID,
711711
)
712712

713713
// If the payment was locally initiated (which is indicated by a nil
@@ -821,7 +821,7 @@ type mailOrchConfig struct {
821821

822822
// failMailboxUpdate is used to fail an expired HTLC and use the
823823
// correct SCID if the underlying channel uses aliases.
824-
failMailboxUpdate func(outScid,
824+
failMailboxUpdate func(ctx context.Context, outScid,
825825
mailboxScid lnwire.ShortChannelID) lnwire.FailureMessage
826826
}
827827

htlcswitch/mailbox_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func newMailboxContextWithClock(t *testing.T,
207207
forwards: make(chan *htlcPacket, 1),
208208
}
209209

210-
failMailboxUpdate := func(outScid,
210+
failMailboxUpdate := func(_ context.Context, outScid,
211211
mboxScid lnwire.ShortChannelID) lnwire.FailureMessage {
212212

213213
return &lnwire.FailTemporaryNodeFailure{}
@@ -233,7 +233,7 @@ func newMailboxContext(t *testing.T, startTime time.Time,
233233
forwards: make(chan *htlcPacket, 1),
234234
}
235235

236-
failMailboxUpdate := func(outScid,
236+
failMailboxUpdate := func(_ context.Context, outScid,
237237
mboxScid lnwire.ShortChannelID) lnwire.FailureMessage {
238238

239239
return &lnwire.FailTemporaryNodeFailure{}
@@ -698,7 +698,7 @@ func testMailBoxDust(t *testing.T, chantype channeldb.ChannelType) {
698698
func TestMailOrchestrator(t *testing.T) {
699699
t.Parallel()
700700

701-
failMailboxUpdate := func(outScid,
701+
failMailboxUpdate := func(_ context.Context, outScid,
702702
mboxScid lnwire.ShortChannelID) lnwire.FailureMessage {
703703

704704
return &lnwire.FailTemporaryNodeFailure{}

htlcswitch/switch.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -2640,11 +2640,9 @@ func (s *Switch) dustExceedsFeeThreshold(link ChannelLink,
26402640
// used in the onion. The mailboxScid is the SCID that the mailbox and link
26412641
// use. The mailboxScid is only used in the non-alias case, so it is always
26422642
// the confirmed SCID.
2643-
func (s *Switch) failMailboxUpdate(outgoingScid,
2643+
func (s *Switch) failMailboxUpdate(ctx context.Context, outgoingScid,
26442644
mailboxScid lnwire.ShortChannelID) lnwire.FailureMessage {
26452645

2646-
ctx := context.TODO()
2647-
26482646
// Try to use the failAliasUpdate function in case this is a channel
26492647
// that uses aliases. If it returns nil, we'll fallback to the original
26502648
// pre-alias behavior.

0 commit comments

Comments
 (0)