@@ -174,6 +174,7 @@ static u8 *open_channel(struct state *state,
174
174
struct basepoints theirs ;
175
175
struct pubkey their_funding_pubkey ;
176
176
secp256k1_ecdsa_signature sig ;
177
+ u32 minimum_depth ;
177
178
const u8 * * wscripts ;
178
179
179
180
set_reserve (& state -> localconf .channel_reserve_satoshis ,
@@ -236,7 +237,7 @@ static u8 *open_channel(struct state *state,
236
237
-> max_htlc_value_in_flight_msat ,
237
238
& state -> remoteconf
238
239
-> channel_reserve_satoshis ,
239
- & state -> remoteconf -> minimum_depth ,
240
+ & minimum_depth ,
240
241
& state -> remoteconf -> htlc_minimum_msat ,
241
242
& state -> remoteconf -> to_self_delay ,
242
243
& state -> remoteconf -> max_accepted_htlcs ,
@@ -266,10 +267,10 @@ static u8 *open_channel(struct state *state,
266
267
* Other fields have the same requirements as their counterparts in
267
268
* `open_channel`.
268
269
*/
269
- if (state -> remoteconf -> minimum_depth > max_minimum_depth )
270
+ if (minimum_depth > max_minimum_depth )
270
271
peer_failed (PEER_FD , & state -> cs , NULL , WIRE_OPENING_BAD_PARAM ,
271
272
"minimum_depth %u larger than %u" ,
272
- state -> remoteconf -> minimum_depth , max_minimum_depth );
273
+ minimum_depth , max_minimum_depth );
273
274
check_config_bounds (state , state -> remoteconf );
274
275
275
276
/* Now, ask master create a transaction to pay those two addresses. */
@@ -397,14 +398,16 @@ static u8 *open_channel(struct state *state,
397
398
& theirs .revocation ,
398
399
& theirs .payment ,
399
400
& theirs .delayed_payment ,
400
- & state -> next_per_commit [REMOTE ]);
401
+ & state -> next_per_commit [REMOTE ],
402
+ minimum_depth );
401
403
}
402
404
403
405
/* This is handed the message the peer sent which caused gossip to stop:
404
406
* it should be an open_channel */
405
407
static u8 * recv_channel (struct state * state ,
406
408
const struct pubkey * our_funding_pubkey ,
407
409
const struct basepoints * ours ,
410
+ u32 minimum_depth ,
408
411
u32 min_feerate , u32 max_feerate , const u8 * peer_msg )
409
412
{
410
413
struct channel_id id_in , channel_id ;
@@ -501,7 +504,7 @@ static u8 *recv_channel(struct state *state,
501
504
state -> localconf
502
505
.max_htlc_value_in_flight_msat ,
503
506
state -> localconf .channel_reserve_satoshis ,
504
- state -> localconf . minimum_depth ,
507
+ minimum_depth ,
505
508
state -> localconf .htlc_minimum_msat ,
506
509
state -> localconf .to_self_delay ,
507
510
state -> localconf .max_accepted_htlcs ,
@@ -637,7 +640,7 @@ int main(int argc, char *argv[])
637
640
struct privkey seed ;
638
641
struct basepoints our_points ;
639
642
struct pubkey our_funding_pubkey ;
640
- u32 max_minimum_depth ;
643
+ u32 minimum_depth , max_minimum_depth ;
641
644
u32 min_feerate , max_feerate ;
642
645
643
646
if (argc == 2 && streq (argv [1 ], "--version" )) {
@@ -685,10 +688,11 @@ int main(int argc, char *argv[])
685
688
& state -> feerate_per_kw , & max_minimum_depth ))
686
689
msg = open_channel (state , & our_funding_pubkey , & our_points ,
687
690
max_minimum_depth );
688
- else if (fromwire_opening_accept (state , msg , NULL , & min_feerate ,
689
- & max_feerate , & peer_msg ))
691
+ else if (fromwire_opening_accept (state , msg , NULL , & minimum_depth ,
692
+ & min_feerate , & max_feerate , & peer_msg ))
690
693
msg = recv_channel (state , & our_funding_pubkey , & our_points ,
691
- min_feerate , max_feerate , peer_msg );
694
+ minimum_depth , min_feerate , max_feerate ,
695
+ peer_msg );
692
696
693
697
/* Write message and hand back the fd. */
694
698
wire_sync_write (REQ_FD , msg );
0 commit comments