channeld: hand in chain_hash.

This will be needed for gossip messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-08-22 14:35:37 +09:30 committed by Christian Decker
parent b3514d3430
commit 2b9d3bb0b7
3 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,7 @@ struct peer {
*/
u64 htlc_id;
struct sha256_double chain_hash;
struct channel_id channel_id;
struct channel *channel;
@ -2004,6 +2005,7 @@ static void init_channel(struct peer *peer)
msg = wire_sync_read(peer, REQ_FD);
if (!fromwire_channel_init(peer, msg, NULL,
&peer->chain_hash,
&funding_txid, &funding_txout,
&funding_satoshi,
&peer->conf[LOCAL], &peer->conf[REMOTE],

View File

@ -22,6 +22,7 @@ channel_normal_operation,1001
# Begin! (passes gossipd-client fd)
channel_init,1
channel_init,,chain_hash,struct sha256_double
channel_init,,funding_txid,struct sha256_double
channel_init,,funding_txout,2
channel_init,,funding_satoshi,8

1 # Shouldn't happen
22 channel_init,,funding_satoshi,8 channel_init,,funding_txout,2
23 channel_init,,our_config,struct channel_config channel_init,,funding_satoshi,8
24 channel_init,,their_config,struct channel_config channel_init,,our_config,struct channel_config
25 channel_init,,their_config,struct channel_config
26 channel_init,,feerate_per_kw,4
27 channel_init,,first_commit_sig,secp256k1_ecdsa_signature
28 channel_init,,crypto_state,struct crypto_state

View File

@ -1643,6 +1643,7 @@ static bool peer_start_channeld(struct peer *peer,
shutdown_scriptpubkey = NULL;
initmsg = towire_channel_init(tmpctx,
&peer->ld->chainparams->genesis_blockhash,
peer->funding_txid,
peer->funding_outnum,
peer->funding_satoshi,