lnd.xprv/htlcswitch/hop
Conner Fromknecht cba523ae30
htlcswitch/hop/payload: apply known constraints if required failure
This commit modifies the NewPayloadFromReader to apply known
presence/omission contraints in the event that the tlv parser returns an
unknown required type failure.

Now that the parser has been modified to finished parsing the stream to
obtain a proper parsed type set, we can accurately apply these higher
level validation checks. This overrides required type failures, such
that they are only returned if the sender properly abided by the
constraints on fields for which we know.

The unit tests are updated to create otherwise valid payloads that then
return unknown required type failures. In one case, a test which
previously returned an unknown required type failure is made to return
an included failure for the sid, indicating the unknown required type 0
is being overruled.
2019-10-30 21:21:10 -07:00
..
error_encryptor.go htlcswitch: move hop iterator into htlcswitch/hop package 2019-09-05 15:30:31 +02:00
forwarding_info.go htlcswitch+hop: move ForwardingInfo to hop.ForwaringInfo 2019-09-05 01:35:23 -07:00
iterator_test.go htlcswitch: move hop iterator into htlcswitch/hop package 2019-09-05 15:30:31 +02:00
iterator.go htlcswitch: move hop iterator into htlcswitch/hop package 2019-09-05 15:30:31 +02:00
log.go htlcswitch: move hop iterator into htlcswitch/hop package 2019-09-05 15:30:31 +02:00
network.go htlcswitch/hop: move NetworkHop to hop.Network 2019-09-05 01:35:20 -07:00
payload_test.go htlcswitch/hop/payload: apply known constraints if required failure 2019-10-30 21:21:10 -07:00
payload.go htlcswitch/hop/payload: apply known constraints if required failure 2019-10-30 21:21:10 -07:00
type.go htlcswitch/hop: move hop.Exit and hop.Source to hop pkg 2019-09-05 01:35:23 -07:00