channeld: use an enum side not a bool for funder/

This predated our handling of enums.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-07-04 10:15:28 +09:30
parent 7884343c15
commit 94a33a7d15
3 changed files with 6 additions and 6 deletions

View File

@ -1950,7 +1950,7 @@ static void init_channel(struct peer *peer)
u64 local_msatoshi;
struct pubkey funding_pubkey[NUM_SIDES];
struct sha256_double funding_txid;
bool am_funder;
enum side funder;
enum htlc_state *hstates;
struct fulfilled_htlc *fulfilled;
enum side *fulfilled_sides;
@ -1976,7 +1976,7 @@ static void init_channel(struct peer *peer)
&points[REMOTE].delayed_payment,
&peer->remote_per_commit,
&peer->old_remote_per_commit,
&am_funder,
&funder,
&peer->fee_base,
&peer->fee_per_satoshi,
&local_msatoshi,
@ -2015,7 +2015,7 @@ static void init_channel(struct peer *peer)
" next_idx_local = %"PRIu64
" next_idx_remote = %"PRIu64
" revocations_received = %"PRIu64,
am_funder ? "LOCAL" : "REMOTE",
side_to_str(funder),
type_to_string(trc, struct pubkey,
&peer->remote_per_commit),
type_to_string(trc, struct pubkey,
@ -2043,7 +2043,7 @@ static void init_channel(struct peer *peer)
&points[LOCAL], &points[REMOTE],
&funding_pubkey[LOCAL],
&funding_pubkey[REMOTE],
am_funder ? LOCAL : REMOTE);
funder);
if (!channel_force_htlcs(peer->channel, htlcs, hstates,
fulfilled, fulfilled_sides,

View File

@ -36,7 +36,7 @@ channel_init,,payment_basepoint,33
channel_init,,delayed_payment_basepoint,33
channel_init,,remote_per_commit,33
channel_init,,old_remote_per_commit,33
channel_init,,am_funder,bool
channel_init,,funder,enum side
channel_init,,fee_base,4
channel_init,,fee_proportional,4
channel_init,,local_msatoshi,8

1 # Shouldn't happen
36 channel_init,,fee_proportional,4
37 channel_init,,local_msatoshi,8
38 channel_init,,seed,struct privkey
39 channel_init,,local_node_id,struct pubkey
40 channel_init,,remote_node_id,struct pubkey
41 channel_init,,commit_msec,4
42 channel_init,,cltv_delta,u16

View File

@ -1201,7 +1201,7 @@ static bool peer_start_channeld(struct peer *peer,
&peer->channel_info->theirbase.delayed_payment,
&peer->channel_info->remote_per_commit,
&peer->channel_info->old_remote_per_commit,
peer->funder == LOCAL,
peer->funder,
cfg->fee_base,
cfg->fee_per_satoshi,
*peer->balance,