htlcswitch: remove unused function in switch

This commit is contained in:
yyforyongyu 2021-07-23 09:33:57 +08:00
parent 22848df07a
commit 1274e31dfb
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
3 changed files with 5 additions and 16 deletions

@ -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)
}

@ -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,

@ -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