onchaind: Pass genesis hash to onchaind so it knows the chainparams

It'll be creating quite a few transactions and we will have to know which
params to use.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-07-30 16:24:13 +02:00
committed by Rusty Russell
parent dbc0265a5d
commit 15e73e3dc3
4 changed files with 8 additions and 1 deletions

View File

@@ -438,6 +438,7 @@ enum watch_result onchaind_funding_spent(struct channel *channel,
struct pubkey final_key;
int hsmfd;
u32 feerate;
const struct chainparams *chainparams;
channel_fail_permanent(channel, "Funding transaction spent");
@@ -507,8 +508,11 @@ enum watch_result onchaind_funding_spent(struct channel *channel,
feerate = feerate_floor();
}
chainparams = get_chainparams(channel->peer->ld);
msg = towire_onchain_init(channel,
&channel->their_shachain.chain,
&chainparams->genesis_blockhash,
channel->funding,
&channel->channel_info.old_remote_per_commit,
&channel->channel_info.remote_per_commit,