Commit Graph

8 Commits

Author SHA1 Message Date
Rusty Russell 940053d000 htlc: move enum side crom daemon/channel.h to daemon/htlc.h
lightningd wants htlcs, but not the old struct channel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-02-02 14:48:00 +10:30
Rusty Russell d8af789bbb channel: remove enum channel_side, rename htlc_side to side.
We had enum channel_side (OURS, THEIRS) for which end of a channel we
had, and htlc_side (LOCAL, REMOTE) for who proposed the HTLC.

Combine these both into simply "enum side".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-31 16:06:32 +09:30
Rusty Russell 8a3c9908ce protocol: no signature in update_commit if receiver has no outputs.
So if there are no HTLCs, and the receiver can't spend anyway, don't
sign.  This has the added benefit that no two signed commitment
transactions will ever be identical (the revocation preimage changes).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:25:13 +09:30
Rusty Russell 23f9c7c209 permute_tx: don't save permutation map.
We no longer need it anywhere.  This simplifies things to the point where
we might as well just not include dust outputs as we go, rather than
explicitly removing them, which gets rid of remove_dust.c as well.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:23:46 +09:30
Rusty Russell 1f99268633 commit_tx: expose wscript and scriptpubkey for to_us/to_them payments.
This is useful for locating them given a random on-chain transaction.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:23:45 +09:30
Rusty Russell d9e825bc2c create_commit_tx: use HTLC map, not cstate HTLC array.
The HTLC state tells us whether a HTLC is in the commitment transaction.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:23:45 +09:30
Rusty Russell ef77cb8349 commit_tx: expose internals to give access to HTLC witness scripts.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:23:45 +09:30
Rusty Russell ca142a0b47 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> 2016-08-18 14:23:45 +09:30