Commit Graph

5 Commits

Author SHA1 Message Date
Rusty Russell ed3f0115d6 protocol: fix horribly thinko, keep own secrets.
I had each side using the other side's hash secret.  That's a very
dumb idea, since it means you can steal from a unilateral close!

A's secret applies to A's commit transaction: it needs the
secret and B's final signature to steal funds, and that should
never happen (since A doesn't have the B's final signature, and
once A has given B the secret, they never broadcast the commit tx).

This makes the update a 4 step dance, since you need the new
revocation hash to make the other side's TX to sign.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-10 21:39:45 +09:30
Rusty Russell 9caf2c71e8 close-channel / create-close-tx: take into account updates.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-09 14:29:04 +09:30
Rusty Russell ecb39efed1 find_p2sh_out: extract helper.
Really only for our silly little utils.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-09 14:13:21 +09:30
Rusty Russell c6ed5926cb close-channel: add --complete option.
Code is identical, so don't create separate close-channel-complete binary.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-08 14:54:02 +09:30
Rusty Russell 38f7a23064 close-channel: create message to mutually close channel.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-08 14:46:41 +09:30