Browse Source

opening: Passing feerate_per_kw through to master

ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
5e1dcea5b8
  1. 4
      lightningd/opening/opening.c
  2. 2
      lightningd/opening/opening_wire.csv
  3. 5
      lightningd/peer_control.c
  4. 1
      lightningd/peer_htlcs.h

4
lightningd/opening/opening.c

@ -451,7 +451,8 @@ static u8 *funder_channel(struct state *state,
&state->next_per_commit[REMOTE],
minimum_depth,
&their_funding_pubkey,
&state->funding_txid);
&state->funding_txid,
state->feerate_per_kw);
}
/* This is handed the message the peer sent which caused gossip to stop:
@ -671,6 +672,7 @@ static u8 *fundee_channel(struct state *state,
state->funding_satoshis,
state->push_msat,
channel_flags,
state->feerate_per_kw,
msg);
}

2
lightningd/opening/opening_wire.csv

@ -50,6 +50,7 @@ opening_funder_reply,,their_per_commit_point,33
opening_funder_reply,,minimum_depth,4
opening_funder_reply,,remote_fundingkey,33
opening_funder_reply,,funding_txid,struct sha256_double
opening_funder_reply,,feerate_per_kw,4
# This means they offer the open (contains their offer packet)
opening_fundee,3
@ -74,6 +75,7 @@ opening_fundee_reply,,funding_txout,u16
opening_fundee_reply,,funding_satoshis,8
opening_fundee_reply,,push_msat,8
opening_fundee_reply,,channel_flags,u8
opening_fundee_reply,,feerate_per_kw,4
# The (encrypted) funding signed message: send this and we're committed.
opening_fundee_reply,,msglen,u16
opening_fundee_reply,,funding_signed_msg,msglen*u8

Can't render this file because it has a wrong number of fields in line 2.

5
lightningd/peer_control.c

@ -1273,7 +1273,8 @@ static bool opening_funder_finished(struct subd *opening, const u8 *resp,
&channel_info->remote_per_commit,
&fc->peer->minimum_depth,
&channel_info->remote_fundingkey,
&funding_txid)) {
&funding_txid,
&channel_info->feerate_per_kw)) {
log_broken(fc->peer->log, "bad OPENING_FUNDER_REPLY %s",
tal_hex(resp, resp));
tal_free(fc->peer);
@ -1372,6 +1373,7 @@ static bool opening_fundee_finished(struct subd *opening,
&peer->funding_satoshi,
&peer->push_msat,
&peer->channel_flags,
&channel_info->feerate_per_kw,
&funding_signed)) {
log_broken(peer->log, "bad OPENING_FUNDEE_REPLY %s",
tal_hex(reply, reply));
@ -1499,6 +1501,7 @@ void peer_fundee_open(struct peer *peer, const u8 *from_peer,
cs, peer->seed);
subd_send_msg(peer->owner, take(msg));
/* FIXME: Expose the min_feerate_per_kw and max_feerate_per_kw in the config */
msg = towire_opening_fundee(peer, peer->minimum_depth,
7500, 150000, from_peer);

1
lightningd/peer_htlcs.h

@ -12,6 +12,7 @@ struct channel_info {
struct pubkey remote_fundingkey;
struct basepoints theirbase;
struct pubkey remote_per_commit, old_remote_per_commit;
u32 feerate_per_kw;
};
/* Get all HTLCs for a peer, to send in init message. */

Loading…
Cancel
Save