Commit Graph

8 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 3957f1e1c1 update-channel-accept: accept the channel update.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-09 14:13:27 +09:30
Rusty Russell d51f6372aa update-channel: prepare a new tx with modified amounts.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-09 14:13:27 +09:30
Rusty Russell 8516798645 signature: fix signatures for p2sh inputs.
The subscript in this case is the redeemscript, not the input script.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-04 21:06:42 +09:30
Rusty Russell 17c56a8cfc Fix DER encoding.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-04 15:46:49 +09:30
Rusty Russell a6d1c65683 Use new opt_usage_exit_fail().
opt_usage_and_exit() exits with status 0, and prints to stdout.
This exits status 1 and prints to stderr.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-04 14:15:19 +09:30
Rusty Russell cf333e45e1 Fix thinko: open-commit-sig needs to sign *their* commit tx.
And check-commit-sig needs to check it against ours.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-03 13:58:23 +09:30
Rusty Russell c291d19af6 Add check-commit-sig.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-02 14:28:59 +09:30