Commit Graph

5 Commits

Author SHA1 Message Date
Rusty Russell 7884343c15 tools/generate-wire.py: enums are assignable.
Simplfies their marshalling/unmarshalling.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-07-12 10:21:16 +09:30
Rusty Russell 3f65f0f000 lightningd: fix up malformed onion handling.
In the case where we can't decrypt the onion, we can't fail it in the
normal way (which is encrypted using the onion shared secret), we need
to respond with a update_fail_malformed_htlc message.

Moreover, we need to remember this for persistence.  This means that
we really have three conclusions for an HTLC: fulfilled, failed,
malformed.  Fix up the logic everywhere which assumed failed or
fulfilled.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-06-23 09:29:42 +09:30
Rusty Russell f918c3a0e7 lightningd/htlc_wire: routines to marshal/unmarshal enum side.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-06-23 09:29:42 +09:30
Rusty Russell be1b9eb4cf lightningd/htlc_wire: routines to marshal/unmarshal enum htlc_state.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-06-23 09:29:42 +09:30
Rusty Russell ad3ab53fa4 lightningd/htlc_wire: wire types for sending HTLCs to/from channel daemon.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-06-23 09:29:42 +09:30