diff --git a/lightningd/channel/channel.c b/lightningd/channel/channel.c index d983e0b57..dab45de40 100644 --- a/lightningd/channel/channel.c +++ b/lightningd/channel/channel.c @@ -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, diff --git a/lightningd/channel/channel_wire.csv b/lightningd/channel/channel_wire.csv index 0a94a6b29..d887630d6 100644 --- a/lightningd/channel/channel_wire.csv +++ b/lightningd/channel/channel_wire.csv @@ -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 diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 4c38e8dc3..29c119b77 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -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,