diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index 41f51ad0f..1f99a1d9d 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -2446,7 +2446,7 @@ func TestChannelLinkBandwidthConsistency(t *testing.T) { addPkt.outgoingChanID = carolChanID addPkt.outgoingHTLCID = 0 - err = coreLink.cfg.Switch.openCircuits(addPkt.keystone()) + err = coreLink.cfg.Circuits.OpenCircuits(addPkt.keystone()) if err != nil { t.Fatalf("unable to set keystone: %v", err) } @@ -2554,7 +2554,7 @@ func TestChannelLinkBandwidthConsistency(t *testing.T) { addPkt.outgoingChanID = carolChanID addPkt.outgoingHTLCID = 1 - err = coreLink.cfg.Switch.openCircuits(addPkt.keystone()) + err = coreLink.cfg.Circuits.OpenCircuits(addPkt.keystone()) if err != nil { t.Fatalf("unable to set keystone: %v", err) } diff --git a/htlcswitch/mock.go b/htlcswitch/mock.go index fd2964465..ce9b0f838 100644 --- a/htlcswitch/mock.go +++ b/htlcswitch/mock.go @@ -671,7 +671,8 @@ func (f *mockChannelLink) completeCircuit(pkt *htlcPacket) error { htlc.ID = f.htlcID keystone := Keystone{pkt.inKey(), pkt.outKey()} - if err := f.htlcSwitch.openCircuits(keystone); err != nil { + err := f.htlcSwitch.circuits.OpenCircuits(keystone) + if err != nil { return err } @@ -690,7 +691,7 @@ func (f *mockChannelLink) completeCircuit(pkt *htlcPacket) error { } func (f *mockChannelLink) deleteCircuit(pkt *htlcPacket) error { - return f.htlcSwitch.deleteCircuits(pkt.inKey()) + return f.htlcSwitch.circuits.DeleteCircuits(pkt.inKey()) } func newMockChannelLink(htlcSwitch *Switch, chanID lnwire.ChannelID, diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index bf56f1593..908ade7f0 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -2234,18 +2234,6 @@ func (s *Switch) commitCircuits(circuits ...*PaymentCircuit) ( return s.circuits.CommitCircuits(circuits...) } -// openCircuits preemptively writes the keystones for Adds that are about to be -// added to a commitment txn. -func (s *Switch) openCircuits(keystones ...Keystone) error { - return s.circuits.OpenCircuits(keystones...) -} - -// deleteCircuits persistently removes the circuit, and keystone if present, -// from the circuit map. -func (s *Switch) deleteCircuits(inKeys ...CircuitKey) error { - return s.circuits.DeleteCircuits(inKeys...) -} - // FlushForwardingEvents flushes out the set of pending forwarding events to // the persistent log. This will be used by the switch to periodically flush // out the set of forwarding events to disk. External callers can also use this