lnd.xprv/htlcswitch
Conner Fromknecht aefec9b10f
tlv: return parsed types from DecodeWithParsedTypes
This commit adds an additional return value to
Stream.DecodeWithParsedTypes, which returns the set of types that were
encountered during decoding. The set will contain all known types that
were decoded, as well as unknown odd types that were ignored.

The rationale for the return value (rather than an internal member) is
so that the stream remains stateless.

This return value can be used by callers during decoding to make
assertions as to whether specific types were included in the stream.
This is need, for example, when parsing onion payloads where certain
fields must be included/omitted depending on the hop type.

The original Decode method would incur the additional performance hit of
needing to track the parsed types, so we can selectively enable this
functionality when a decoder requires it by using a helper which
conditionally tracks the parsed types.
2019-09-05 09:30:37 -07:00
..
hodl htlcswitch/hodl: switch from debug tag to dev 2018-10-05 13:04:45 +09:00
hop tlv: return parsed types from DecodeWithParsedTypes 2019-09-05 09:30:37 -07:00
circuit_map.go htlcswitch/hop: move hop.Exit and hop.Source to hop pkg 2019-09-05 01:35:23 -07:00
circuit_test.go multi: update to go 1.11 gofmt 2018-10-07 14:37:38 +09:00
circuit.go multi: fix various typos in comments 2018-09-07 06:51:49 +02:00
decayedlog_test.go htlcswitch/decayedlog_test: fix bug in gc unit test 2018-06-27 14:40:28 -07:00
decayedlog.go multi: switch from bolt packge to bbolt package for all imports 2018-11-29 20:33:49 -08:00
failure.go htlcswitch: do not consider unknown failures an error 2019-07-11 19:49:49 +02:00
interfaces.go multi: use separate cltv expiry field from invoice 2019-09-04 19:20:19 +02:00
iterator_test.go htlcswitch+hop: move ForwardingInfo to hop.ForwaringInfo 2019-09-05 01:35:23 -07:00
iterator.go htlcswitch/iterator: use hop.Payload constructors 2019-09-05 01:35:24 -07:00
link_test.go htlcswitch/hop: move hop.Exit and hop.Source to hop pkg 2019-09-05 01:35:23 -07:00
link.go htlcswitch/hop: move hop.Exit and hop.Source to hop pkg 2019-09-05 01:35:23 -07:00
linkfailure.go htlcswitch/linkfailure: define LinkFailureError 2018-05-25 06:58:18 +02:00
log.go multi: init subsystem loggers via build pkg 2018-10-05 13:04:45 +09:00
mailbox_test.go htlcswitch/mailbox_test: add orchestrator pending/live test 2018-05-09 16:07:52 -07:00
mailbox.go multi: replace manual CAS with sync.Once in several more modules 2019-06-12 09:37:26 -03:00
mock.go htlcswitch+hop: move ForwardingInfo to hop.ForwaringInfo 2019-09-05 01:35:23 -07:00
packet.go htlcswitch: for UpdateFailMalformedHTLC packets mark fail as needing conversion 2019-04-30 20:13:34 -07:00
payment_result_test.go htlcswitch/payment_result_test: add TestNetworkResultStore 2019-06-07 16:53:33 +02:00
payment_result.go htlcswitch/payment_result: add paymentResultStore 2019-06-07 16:53:32 +02:00
queue_test.go htlcswitch: Remove obsolete fields from htlcPacket. 2017-12-14 17:53:58 -08:00
queue.go htlcswitch: ensure the packet queue exits on stop 2018-06-08 13:51:37 -07:00
sequencer.go multi: switch from bolt packge to bbolt package for all imports 2018-11-29 20:33:49 -08:00
switch_test.go htlcswitch: always assume an onion error for malformed htlc failures 2019-08-17 10:24:05 +02:00
switch.go htlcswitch/hop: move hop.Exit and hop.Source to hop pkg 2019-09-05 01:35:23 -07:00
test_utils.go htlcswitch/hop: move hop.Exit and hop.Source to hop pkg 2019-09-05 01:35:23 -07:00