Commit Graph

14 Commits

Author SHA1 Message Date
Rusty Russell 9aa0eac814 bitcoin: hand in a secp256k1_context to all routines.
We don't want to re-create them internally, ever.

The test-cli tools are patched to generate them all the time, but
they're not performance critical.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:47 +10:30
Rusty Russell 6d6abd57e7 funding: remove protobufs.
Use our own structure with the information we need about HTLCs,
and remove protobufs from the API.

The is_funder() helper goes inside gather_updates.h.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:47 +10:30
Rusty Russell d95d8a99c2 create_commit_tx: don't use protobufs in the API.
Hand anchor details and pubkeys directly; this is what we want
for the actual daemon which doesn't keep raw packets around.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:47 +10:30
Rusty Russell 93b5db89a8 signature: expose check_signed_hash()
This is wanted for crypto communications to check signature.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:45 +10:30
Rusty Russell 242fa1b2dd pubkey: pubkey_eq helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-09-30 16:38:58 +09:30
Rusty Russell 1cb147c5b8 Version number, name, and build details.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-08 20:45:49 +09:30
Rusty Russell a4dfe3ad72 channel_state: encapsulate funding of channel in one place.
This shows where funds are going at any time (fees vs to each side).
funding.c is mainly rewritten, and should be clearer now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-07 12:45:30 +09:30
Rusty Russell 142e822342 test-cli/update-channel-signature: remove debugging message.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-05 16:54:53 +09:30
Rusty Russell 3260fb2ed1 protocol: add commitment fee logic.
Both sides elect a commitment fee, and the lowest is chosen.  That means
you can't game the other side (but if you offer too low, then can error
out of course).

Fees are split 50-50 if possible: originally the whole fee has to be
paid by the (single) funder.  Neither side can withdraw funds which
would make them unable to pay fees.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-29 16:16:24 +09:30
Rusty Russell eac3af06f1 protocol: switch to single-funder anchor model.
Most complex change was gather_updates(), which handles all the "what
is the current state of the channel" logic for our dumb test utils.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-29 16:14:28 +09:30
Rusty Russell 2255cb749d protocol: move commitment key to open_channel message.
And rename final to final_key to be clearer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-29 12:00:50 +09:30
Rusty Russell d20ddb5a90 Use libsecp256k1 instead of openssl for crypto.
We still use openssl for bignums (base58) and for ripemd.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-01 16:27:52 +09:30
Rusty Russell 92ec2f874b pkt: add pkt_totlen() helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-12 13:06:33 +09:30
Rusty Russell 4e8eda47a1 Move hacky command line utils out to test-cli subdir.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-12 12:35:42 +09:30