lnd.xprv/htlcswitch
Olaoluwa Osuntokun 5e3b239ebc
htlcswitch: ensure we don't attempt to create fwding events for fails
In this commit, we fix an existing source of a panic, that could at
times lead to a deadlock. If the circuit returned from closeCircuit
didn't have an outgoing key (as it was an incomplete forward), then we
would attempt to de-ref a nil pointer. This would trigger a panic, and
the runtime would start to unwind the stack, and execute each defer in
line. A deadlock can arise here, as in the defer at the root goroutine,
we need to grab the fwdingEventMtx. However, we already have it at the
panic site.

We fix this issue by ensuring we only attempt to add the event if it's a
_settle_ and also actually has an outgoing circuit (which it should
already, just a defensive check).
2018-05-22 16:46:55 -07:00
..
hodl htlcswitch/hodl_mask_test: tests HodlMask active flags 2018-05-02 00:18:50 -07:00
circuit_map.go multi: use mutex-guarded ShortChanID() on OpenChannel 2018-05-09 16:06:49 -07:00
circuit_test.go multi: Complete upgrade to new sphinx package interface. 2018-05-02 00:22:25 -07:00
circuit.go htlcswitch/circuit: add half adds to circuit map 2018-03-09 21:08:42 -08:00
decayedlog_test.go htlcswitch: Move DecayedLog definition from sphinx package. 2018-05-02 00:22:24 -07:00
decayedlog.go htlcswitch: Move DecayedLog definition from sphinx package. 2018-05-02 00:22:24 -07:00
failure.go htlcswitch/failure: add Reextract to SphinxErrorEncrypter 2018-03-13 16:33:28 -07:00
interfaces.go htlcswitch/interfaces: return err from UpdateShortChanID 2018-05-09 16:06:49 -07:00
iterator.go htlcswitch/iterator: extract error encrypter from ephemeral key 2018-03-13 16:33:28 -07:00
link_test.go link test: add TestChannelLinkWaitForRevocation 2018-05-09 08:47:21 +02:00
link.go htlcswitch/link: fix UpdateShortChanID 2018-05-09 16:07:25 -07:00
log.go htlcswitch: add additional comments and logging 2018-03-12 18:58:44 -07:00
mailbox_test.go htlcswitch/mailbox_test: add orchestrator pending/live test 2018-05-09 16:07:52 -07:00
mailbox.go htlcswitch/mailbox: adds mailOrchestrator 2018-05-09 16:07:51 -07:00
mock.go Merge pull request #945 from jimpo/decayedlog 2018-05-10 20:06:53 -07:00
packet.go htlcswitch/packet: adds serialization to htlcPacket 2018-03-09 21:08:44 -08:00
queue_test.go htlcswitch: Remove obsolete fields from htlcPacket. 2017-12-14 17:53:58 -08:00
queue.go multi: fix a-vs-an typos 2018-04-17 19:02:04 -07:00
sequencer.go build+multi: switch from bolt to bbolt 2018-03-10 19:01:13 -08:00
switch_test.go htlcswitch/switch_test: test send pending channel 2018-05-09 16:07:51 -07:00
switch.go htlcswitch: ensure we don't attempt to create fwding events for fails 2018-05-22 16:46:55 -07:00
test_utils.go multi: use mutex-guarded ShortChanID() on OpenChannel 2018-05-09 16:06:49 -07:00