From be129eb7c7f5bdd43d33b54aa612f3ba5e170997 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Thu, 16 May 2019 15:27:28 +0200 Subject: [PATCH] htlcswitch/switch: remove numPendingPayments only used in tests --- htlcswitch/switch.go | 9 --------- htlcswitch/switch_test.go | 4 ---- 2 files changed, 13 deletions(-) diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index a41081ce..e45ab4f9 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -2206,15 +2206,6 @@ func (s *Switch) CircuitModifier() CircuitModifier { return s.circuits } -// numPendingPayments is helper function which returns the overall number of -// pending user payments. -func (s *Switch) numPendingPayments() int { - s.pendingMutex.RLock() - defer s.pendingMutex.RUnlock() - - return len(s.pendingPayments) -} - // commitCircuits persistently adds a circuit to the switch's circuit map. func (s *Switch) commitCircuits(circuits ...*PaymentCircuit) ( *CircuitFwdActions, error) { diff --git a/htlcswitch/switch_test.go b/htlcswitch/switch_test.go index 73aee0ad..693e9bcc 100644 --- a/htlcswitch/switch_test.go +++ b/htlcswitch/switch_test.go @@ -1798,10 +1798,6 @@ func TestSwitchSendPayment(t *testing.T) { case <-time.After(time.Second): t.Fatal("err wasn't received") } - - if s.numPendingPayments() != 0 { - t.Fatal("wrong amount of pending payments") - } } // TestLocalPaymentNoForwardingEvents tests that if we send a series of locally