mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-26 20:30:59 +01:00
channeld: Tell channeld the penalty feerate
`channeld` will start creating the penalty transactions in one of the next commits, so it should know the penalty feerate.
This commit is contained in:
parent
93eaf3017d
commit
acbd583e66
3 changed files with 15 additions and 4 deletions
|
@ -18,6 +18,7 @@ msgdata,channel_init,their_config,channel_config,
|
||||||
msgdata,channel_init,fee_states,fee_states,
|
msgdata,channel_init,fee_states,fee_states,
|
||||||
msgdata,channel_init,feerate_min,u32,
|
msgdata,channel_init,feerate_min,u32,
|
||||||
msgdata,channel_init,feerate_max,u32,
|
msgdata,channel_init,feerate_max,u32,
|
||||||
|
msgdata,channel_init,feerate_penalty,u32,
|
||||||
msgdata,channel_init,first_commit_sig,bitcoin_signature,
|
msgdata,channel_init,first_commit_sig,bitcoin_signature,
|
||||||
msgdata,channel_init,per_peer_state,per_peer_state,
|
msgdata,channel_init,per_peer_state,per_peer_state,
|
||||||
msgdata,channel_init,remote_fundingkey,pubkey,
|
msgdata,channel_init,remote_fundingkey,pubkey,
|
||||||
|
@ -178,6 +179,7 @@ msgtype,channel_feerates,1027
|
||||||
msgdata,channel_feerates,feerate,u32,
|
msgdata,channel_feerates,feerate,u32,
|
||||||
msgdata,channel_feerates,min_feerate,u32,
|
msgdata,channel_feerates,min_feerate,u32,
|
||||||
msgdata,channel_feerates,max_feerate,u32,
|
msgdata,channel_feerates,max_feerate,u32,
|
||||||
|
msgdata,channel_feerates,penalty_feerate,u32,
|
||||||
|
|
||||||
# master -> channeld: do you have a memleak?
|
# master -> channeld: do you have a memleak?
|
||||||
msgtype,channel_dev_memleak,1033
|
msgtype,channel_dev_memleak,1033
|
||||||
|
|
|
|
@ -84,6 +84,9 @@ struct peer {
|
||||||
/* Tolerable amounts for feerate (only relevant for fundee). */
|
/* Tolerable amounts for feerate (only relevant for fundee). */
|
||||||
u32 feerate_min, feerate_max;
|
u32 feerate_min, feerate_max;
|
||||||
|
|
||||||
|
/* Feerate to be used when creating penalty transactions. */
|
||||||
|
u32 feerate_penalty;
|
||||||
|
|
||||||
/* Local next per-commit point. */
|
/* Local next per-commit point. */
|
||||||
struct pubkey next_local_per_commit;
|
struct pubkey next_local_per_commit;
|
||||||
|
|
||||||
|
@ -2816,7 +2819,8 @@ static void handle_feerates(struct peer *peer, const u8 *inmsg)
|
||||||
|
|
||||||
if (!fromwire_channel_feerates(inmsg, &feerate,
|
if (!fromwire_channel_feerates(inmsg, &feerate,
|
||||||
&peer->feerate_min,
|
&peer->feerate_min,
|
||||||
&peer->feerate_max))
|
&peer->feerate_max,
|
||||||
|
&peer->feerate_penalty))
|
||||||
master_badmsg(WIRE_CHANNEL_FEERATES, inmsg);
|
master_badmsg(WIRE_CHANNEL_FEERATES, inmsg);
|
||||||
|
|
||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
|
@ -3110,7 +3114,9 @@ static void init_channel(struct peer *peer)
|
||||||
&minimum_depth,
|
&minimum_depth,
|
||||||
&conf[LOCAL], &conf[REMOTE],
|
&conf[LOCAL], &conf[REMOTE],
|
||||||
&fee_states,
|
&fee_states,
|
||||||
&peer->feerate_min, &peer->feerate_max,
|
&peer->feerate_min,
|
||||||
|
&peer->feerate_max,
|
||||||
|
&peer->feerate_penalty,
|
||||||
&peer->their_commit_sig,
|
&peer->their_commit_sig,
|
||||||
&peer->pps,
|
&peer->pps,
|
||||||
&funding_pubkey[REMOTE],
|
&funding_pubkey[REMOTE],
|
||||||
|
|
|
@ -38,7 +38,8 @@ static void update_feerates(struct lightningd *ld, struct channel *channel)
|
||||||
|
|
||||||
msg = towire_channel_feerates(NULL, feerate,
|
msg = towire_channel_feerates(NULL, feerate,
|
||||||
feerate_min(ld, NULL),
|
feerate_min(ld, NULL),
|
||||||
feerate_max(ld, NULL));
|
feerate_max(ld, NULL),
|
||||||
|
try_get_feerate(ld->topology, FEERATE_PENALTY));
|
||||||
subd_send_msg(channel->owner, take(msg));
|
subd_send_msg(channel->owner, take(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,6 +481,7 @@ void peer_start_channeld(struct channel *channel,
|
||||||
channel->channel_info.fee_states,
|
channel->channel_info.fee_states,
|
||||||
feerate_min(ld, NULL),
|
feerate_min(ld, NULL),
|
||||||
feerate_max(ld, NULL),
|
feerate_max(ld, NULL),
|
||||||
|
try_get_feerate(ld->topology, FEERATE_PENALTY),
|
||||||
&channel->last_sig,
|
&channel->last_sig,
|
||||||
pps,
|
pps,
|
||||||
&channel->channel_info.remote_fundingkey,
|
&channel->channel_info.remote_fundingkey,
|
||||||
|
@ -819,7 +821,8 @@ static struct command_result *json_dev_feerate(struct command *cmd,
|
||||||
|
|
||||||
msg = towire_channel_feerates(NULL, *feerate,
|
msg = towire_channel_feerates(NULL, *feerate,
|
||||||
feerate_min(cmd->ld, NULL),
|
feerate_min(cmd->ld, NULL),
|
||||||
feerate_max(cmd->ld, NULL));
|
feerate_max(cmd->ld, NULL),
|
||||||
|
try_get_feerate(cmd->ld->topology, FEERATE_PENALTY));
|
||||||
subd_send_msg(channel->owner, take(msg));
|
subd_send_msg(channel->owner, take(msg));
|
||||||
|
|
||||||
response = json_stream_success(cmd);
|
response = json_stream_success(cmd);
|
||||||
|
|
Loading…
Add table
Reference in a new issue