Browse Source

generate-wire.py: generate chain_hash fields as sha256_double.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
b3514d3430
  1. 4
      lightningd/opening/opening.c
  2. 2
      tools/generate-wire.py
  3. 2
      wire/test/run-peer-wire.c

4
lightningd/opening/opening.c

@ -243,7 +243,7 @@ static u8 *funder_channel(struct state *state,
1000 * state->funding_satoshis);
msg = towire_open_channel(state,
&state->chainparams->genesis_blockhash.sha,
&state->chainparams->genesis_blockhash,
&channel_id,
state->funding_satoshis, state->push_msat,
state->localconf.dust_limit_satoshis,
@ -479,7 +479,7 @@ static u8 *fundee_channel(struct state *state,
* `delayed_payment_basepoint` are not valid DER-encoded compressed
* secp256k1 pubkeys.
*/
if (!fromwire_open_channel(peer_msg, NULL, &chain_hash.sha, &channel_id,
if (!fromwire_open_channel(peer_msg, NULL, &chain_hash, &channel_id,
&state->funding_satoshis, &state->push_msat,
&state->remoteconf->dust_limit_satoshis,
&state->remoteconf->max_htlc_value_in_flight_msat,

2
tools/generate-wire.py

@ -17,6 +17,7 @@ type2size = {
'struct preimage': 32,
'struct pubkey': 33,
'struct sha256': 32,
'struct sha256_double': 32,
'u64': 8,
'u32': 4,
'u16': 2,
@ -76,6 +77,7 @@ partialtypemap = {
'signature': FieldType('secp256k1_ecdsa_signature'),
'features': FieldType('u8'),
'channel_id': FieldType('struct channel_id'),
'chain_hash': FieldType('struct sha256_double'),
'pad': FieldType('pad'),
}

2
wire/test/run-peer-wire.c

@ -164,7 +164,7 @@ struct msg_node_announcement {
u8 *addresses;
};
struct msg_open_channel {
struct sha256 chain_hash;
struct sha256_double chain_hash;
struct channel_id temporary_channel_id;
u64 funding_satoshis;
u64 push_msat;

Loading…
Cancel
Save