mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
generate-wire.py: generate chain_hash fields as sha256_double.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
26ffa8fdec
commit
b3514d3430
@@ -243,7 +243,7 @@ static u8 *funder_channel(struct state *state,
|
|||||||
1000 * state->funding_satoshis);
|
1000 * state->funding_satoshis);
|
||||||
|
|
||||||
msg = towire_open_channel(state,
|
msg = towire_open_channel(state,
|
||||||
&state->chainparams->genesis_blockhash.sha,
|
&state->chainparams->genesis_blockhash,
|
||||||
&channel_id,
|
&channel_id,
|
||||||
state->funding_satoshis, state->push_msat,
|
state->funding_satoshis, state->push_msat,
|
||||||
state->localconf.dust_limit_satoshis,
|
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
|
* `delayed_payment_basepoint` are not valid DER-encoded compressed
|
||||||
* secp256k1 pubkeys.
|
* 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->funding_satoshis, &state->push_msat,
|
||||||
&state->remoteconf->dust_limit_satoshis,
|
&state->remoteconf->dust_limit_satoshis,
|
||||||
&state->remoteconf->max_htlc_value_in_flight_msat,
|
&state->remoteconf->max_htlc_value_in_flight_msat,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ type2size = {
|
|||||||
'struct preimage': 32,
|
'struct preimage': 32,
|
||||||
'struct pubkey': 33,
|
'struct pubkey': 33,
|
||||||
'struct sha256': 32,
|
'struct sha256': 32,
|
||||||
|
'struct sha256_double': 32,
|
||||||
'u64': 8,
|
'u64': 8,
|
||||||
'u32': 4,
|
'u32': 4,
|
||||||
'u16': 2,
|
'u16': 2,
|
||||||
@@ -76,6 +77,7 @@ partialtypemap = {
|
|||||||
'signature': FieldType('secp256k1_ecdsa_signature'),
|
'signature': FieldType('secp256k1_ecdsa_signature'),
|
||||||
'features': FieldType('u8'),
|
'features': FieldType('u8'),
|
||||||
'channel_id': FieldType('struct channel_id'),
|
'channel_id': FieldType('struct channel_id'),
|
||||||
|
'chain_hash': FieldType('struct sha256_double'),
|
||||||
'pad': FieldType('pad'),
|
'pad': FieldType('pad'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ struct msg_node_announcement {
|
|||||||
u8 *addresses;
|
u8 *addresses;
|
||||||
};
|
};
|
||||||
struct msg_open_channel {
|
struct msg_open_channel {
|
||||||
struct sha256 chain_hash;
|
struct sha256_double chain_hash;
|
||||||
struct channel_id temporary_channel_id;
|
struct channel_id temporary_channel_id;
|
||||||
u64 funding_satoshis;
|
u64 funding_satoshis;
|
||||||
u64 push_msat;
|
u64 push_msat;
|
||||||
|
|||||||
Reference in New Issue
Block a user