mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-25 09:12:03 +01:00
htlcswitch: remove unused function in switch
This commit is contained in:
parent
22848df07a
commit
1274e31dfb
htlcswitch
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user