mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
channeld: add dev-disable-commit-after instead of dev-disconnect -nocommit
It was always a hack, but an impossible one once connectd will be interpreting dev-disconnect! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -653,68 +653,72 @@ void peer_start_channeld(struct channel *channel,
|
||||
tmpctx, channel->peer->ld->wallet, channel->dbid);
|
||||
|
||||
initmsg = towire_channeld_init(tmpctx,
|
||||
chainparams,
|
||||
ld->our_features,
|
||||
&channel->cid,
|
||||
&channel->funding,
|
||||
channel->funding_sats,
|
||||
channel->minimum_depth,
|
||||
get_block_height(ld->topology),
|
||||
channel->blockheight_states,
|
||||
channel->lease_expiry,
|
||||
&channel->our_config,
|
||||
&channel->channel_info.their_config,
|
||||
channel->fee_states,
|
||||
feerate_min(ld, NULL),
|
||||
feerate_max(ld, NULL),
|
||||
try_get_feerate(ld->topology, FEERATE_PENALTY),
|
||||
&channel->last_sig,
|
||||
pps,
|
||||
&channel->channel_info.remote_fundingkey,
|
||||
&channel->channel_info.theirbase,
|
||||
&channel->channel_info.remote_per_commit,
|
||||
&channel->channel_info.old_remote_per_commit,
|
||||
channel->opener,
|
||||
channel->feerate_base,
|
||||
channel->feerate_ppm,
|
||||
channel->our_msat,
|
||||
&channel->local_basepoints,
|
||||
&channel->local_funding_pubkey,
|
||||
&ld->id,
|
||||
&channel->peer->id,
|
||||
cfg->commit_time_ms,
|
||||
cfg->cltv_expiry_delta,
|
||||
channel->last_was_revoke,
|
||||
channel->last_sent_commit,
|
||||
channel->next_index[LOCAL],
|
||||
channel->next_index[REMOTE],
|
||||
num_revocations,
|
||||
channel->next_htlc_id,
|
||||
htlcs,
|
||||
channel->scid != NULL,
|
||||
channel->remote_funding_locked,
|
||||
&scid,
|
||||
reconnected,
|
||||
chainparams,
|
||||
ld->our_features,
|
||||
&channel->cid,
|
||||
&channel->funding,
|
||||
channel->funding_sats,
|
||||
channel->minimum_depth,
|
||||
get_block_height(ld->topology),
|
||||
channel->blockheight_states,
|
||||
channel->lease_expiry,
|
||||
&channel->our_config,
|
||||
&channel->channel_info.their_config,
|
||||
channel->fee_states,
|
||||
feerate_min(ld, NULL),
|
||||
feerate_max(ld, NULL),
|
||||
try_get_feerate(ld->topology, FEERATE_PENALTY),
|
||||
&channel->last_sig,
|
||||
pps,
|
||||
&channel->channel_info.remote_fundingkey,
|
||||
&channel->channel_info.theirbase,
|
||||
&channel->channel_info.remote_per_commit,
|
||||
&channel->channel_info.old_remote_per_commit,
|
||||
channel->opener,
|
||||
channel->feerate_base,
|
||||
channel->feerate_ppm,
|
||||
channel->our_msat,
|
||||
&channel->local_basepoints,
|
||||
&channel->local_funding_pubkey,
|
||||
&ld->id,
|
||||
&channel->peer->id,
|
||||
cfg->commit_time_ms,
|
||||
cfg->cltv_expiry_delta,
|
||||
channel->last_was_revoke,
|
||||
channel->last_sent_commit,
|
||||
channel->next_index[LOCAL],
|
||||
channel->next_index[REMOTE],
|
||||
num_revocations,
|
||||
channel->next_htlc_id,
|
||||
htlcs,
|
||||
channel->scid != NULL,
|
||||
channel->remote_funding_locked,
|
||||
&scid,
|
||||
reconnected,
|
||||
/* Anything that indicates we are or have
|
||||
* shut down */
|
||||
channel->state == CHANNELD_SHUTTING_DOWN
|
||||
channel->state == CHANNELD_SHUTTING_DOWN
|
||||
|| channel->state == CLOSINGD_SIGEXCHANGE
|
||||
|| channel_closed(channel),
|
||||
channel->shutdown_scriptpubkey[REMOTE] != NULL,
|
||||
channel->shutdown_scriptpubkey[LOCAL],
|
||||
channel->channel_flags,
|
||||
fwd_msg,
|
||||
reached_announce_depth,
|
||||
&last_remote_per_commit_secret,
|
||||
channel->peer->their_features,
|
||||
channel->remote_upfront_shutdown_script,
|
||||
remote_ann_node_sig,
|
||||
remote_ann_bitcoin_sig,
|
||||
channel->type,
|
||||
IFDEV(ld->dev_fast_gossip, false),
|
||||
IFDEV(dev_fail_process_onionpacket, false),
|
||||
pbases,
|
||||
reestablish_only);
|
||||
channel->shutdown_scriptpubkey[REMOTE] != NULL,
|
||||
channel->shutdown_scriptpubkey[LOCAL],
|
||||
channel->channel_flags,
|
||||
fwd_msg,
|
||||
reached_announce_depth,
|
||||
&last_remote_per_commit_secret,
|
||||
channel->peer->their_features,
|
||||
channel->remote_upfront_shutdown_script,
|
||||
remote_ann_node_sig,
|
||||
remote_ann_bitcoin_sig,
|
||||
channel->type,
|
||||
IFDEV(ld->dev_fast_gossip, false),
|
||||
IFDEV(dev_fail_process_onionpacket, false),
|
||||
IFDEV(ld->dev_disable_commit == -1
|
||||
? NULL
|
||||
: (u32 *)&ld->dev_disable_commit,
|
||||
NULL),
|
||||
pbases,
|
||||
reestablish_only);
|
||||
|
||||
/* We don't expect a response: we are triggered by funding_depth_cb. */
|
||||
subd_send_msg(channel->owner, take(initmsg));
|
||||
|
||||
Reference in New Issue
Block a user