htlcswitch/test: isolate test packets
Decouple the tests somewhat and fix a bug along the way where the test passed because of a left-over package from a prior test.
This commit is contained in:
2 files changed
+54
-34
No files matched your search
+5
-3
@@ -690,9 +690,11 @@ func (f *mockChannelLink) completeCircuit(pkt *htlcPacket) error {
|
||||
f.htlcID++
|
||||
|
||||
case *lnwire.UpdateFulfillHTLC, *lnwire.UpdateFailHTLC:
|
||||
err := f.htlcSwitch.teardownCircuit(pkt)
|
||||
if err != nil {
|
||||
return err
|
||||
if pkt.circuit != nil {
|
||||
err := f.htlcSwitch.teardownCircuit(pkt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user