Rusty Russell
e1eef5db65
close_tx: don't use protobufs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
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>
9 years ago
Rusty Russell
906a5e4a32
Move pkt.c into test-cli.
We use cryptopkt for normal cases.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
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>
10 years ago
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>
10 years ago
Rusty Russell
c03c878afc
Split into two anchors.
This is a major change; instead of creating a mutual anchor (funding)
transaction, each side creates its own. We use escape transactions in
case anything goes wrong; these will be revoked later.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
8a4246cb36
permute: use BIP69 order.
It's a canonical ordering, rather than a random shuffle. Far simpler.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
1075264c66
close_tx: initialize fee and input amount fields.
Required for alpha.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
ef9463f6b1
Sort include lines (ignoring hacky cli test utils).
Put ccan first, openssl next, then standard headers, then locals.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
442f321585
Move protobuf<->bitcoin converters out of bitcoin/
They're lightning-specific.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
612d713470
Move bitcoin stuff into bitcoin subdir.
It's not very interesting if you're looking for LN code.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
9caf2c71e8
close-channel / create-close-tx: take into account updates.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
38f7a23064
close-channel: create message to mutually close channel.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
4dd6b8e385
lightning.proto: Rename 'to_me' to 'final', use for commit_tx.
This is where the commit tx outputs should pay to.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
29d0cdc3cd
open-channel: use pubkey, not arbitrary script for final outout address.
We need to pay to this from two places: on their side, it's a simple
payment, on our side, it's a complex timeout-or-mutual-or-hval script,
which doesn't lend itself to arbitrary scripts.
Use P2SH, of course.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
316f29cb69
bitcoin_script: wean entirely off protobuf types.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
f911b2b6df
Use pubkey structures in bitcoin_script, rather than protobufs.
This ensures we do checking beforehand, and keeps abstractions clear.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
c04d20e019
commit_tx: new file containing logic to create initial commitment transaction.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago