core-lightning/lightningd/opening/opening_control_wire.csv
Rusty Russell 5f07e8405a lightningd/opening: fix theoretical race.
We should start watching for the transaction before we send the
signature; we might miss it otherwise.  In practice, we only see
transactions as they enter a block, so it won't happen, but be
thorough.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-07 11:35:03 +10:30

2.4 KiB

1#include <lightningd/cryptomsg.h>
2#include <lightningd/channel_config.h>
3opening_init,0
4# Base configuration we'll offer (channel reserve will vary with amount)
5opening_init,0,our_config,36,struct channel_config
6# Minimum/maximum configuration values we'll accept
7opening_init,36,max_to_self_delay,4
8opening_init,40,min_effective_htlc_capacity_msat,8
9opening_init,48,crypto_state,144,struct crypto_state
10# Seed to generate all the keys from
11opening_init,196,seed,32,struct privkey
12# This means we offer the open.
13opening_open,1
14opening_open,0,funding_satoshis,8
15opening_open,8,push_msat,8
16opening_open,16,feerate_per_kw,4
17opening_open,20,max_minimum_depth,4
18# Response asks for txid of funding transaction.
19opening_open_resp,101
20opening_open_resp,0,local_fundingkey,33
21opening_open_resp,0,remote_fundingkey,33
22# Now we give the funding txid and outnum.
23opening_open_funding,2
24opening_open_funding,0,txid,32,struct sha256_double
25opening_open_funding,32,txout,2,u16
26# This gives their sig, means we can broadcast tx: we're done.
27opening_open_funding_resp,102
28opening_open_funding_resp,0,their_config,36,struct channel_config
29opening_open_funding_resp,36,first_commit_sig,64,secp256k1_ecdsa_signature
30opening_open_funding_resp,100,crypto_state,144,struct crypto_state
31opening_open_funding_resp,244,revocation_basepoint,33
32opening_open_funding_resp,277,payment_basepoint,33
33opening_open_funding_resp,310,delayed_payment_basepoint,33
34opening_open_funding_resp,343,their_per_commit_point,33
35# This means they offer the open (contains their offer packet)
36opening_accept,3
37opening_accept,0,min_feerate,4
38opening_accept,4,max_feerate,4
39opening_accept,8,len,2
40opening_accept,10,msg,len,u8
41# This gives the txid of their funding tx to watch.
42opening_accept_resp,103
43opening_accept_resp,0,funding_txid,32,struct sha256_double
44# Acknowledge watch is in place, now can send sig.
45opening_accept_finish,4
46opening_accept_finish_resp,104
47opening_accept_finish_resp,32,funding_txout,2,u16
48opening_accept_finish_resp,0,their_config,36,struct channel_config
49opening_accept_finish_resp,36,first_commit_sig,64,secp256k1_ecdsa_signature
50opening_accept_finish_resp,100,crypto_state,144,struct crypto_state
51opening_accept_finish_resp,244,remote_fundingkey,33
52opening_accept_finish_resp,277,revocation_basepoint,33
53opening_accept_finish_resp,310,payment_basepoint,33
54opening_accept_finish_resp,343,delayed_payment_basepoint,33
55opening_accept_finish_resp,377,their_per_commit_point,33
56# You're OK to exit.
57opening_exit_req,99