diff --git a/channeld/channel.c b/channeld/channel.c index 87ba09353..f6f4d7bc7 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -2514,15 +2514,15 @@ static void init_channel(struct peer *peer) derive_basepoints(&seed, &funding_pubkey[LOCAL], &points[LOCAL], &peer->our_secrets, &peer->shaseed); - peer->channel = new_channel(peer, &funding_txid, funding_txout, - funding_satoshi, - local_msatoshi, - feerate_per_kw, - &peer->conf[LOCAL], &peer->conf[REMOTE], - &points[LOCAL], &points[REMOTE], - &funding_pubkey[LOCAL], - &funding_pubkey[REMOTE], - funder); + peer->channel = new_full_channel(peer, &funding_txid, funding_txout, + funding_satoshi, + local_msatoshi, + feerate_per_kw, + &peer->conf[LOCAL], &peer->conf[REMOTE], + &points[LOCAL], &points[REMOTE], + &funding_pubkey[LOCAL], + &funding_pubkey[REMOTE], + funder); if (!channel_force_htlcs(peer->channel, htlcs, hstates, fulfilled, fulfilled_sides, diff --git a/channeld/full_channel.c b/channeld/full_channel.c index cc3f9e6f3..f92591cce 100644 --- a/channeld/full_channel.c +++ b/channeld/full_channel.c @@ -19,19 +19,19 @@ #include #include -struct channel *new_channel(const tal_t *ctx, - const struct bitcoin_txid *funding_txid, - unsigned int funding_txout, - u64 funding_satoshis, - u64 local_msatoshi, - const u32 feerate_per_kw[NUM_SIDES], - const struct channel_config *local, - const struct channel_config *remote, - const struct basepoints *local_basepoints, - const struct basepoints *remote_basepoints, - const struct pubkey *local_funding_pubkey, - const struct pubkey *remote_funding_pubkey, - enum side funder) +struct channel *new_full_channel(const tal_t *ctx, + const struct bitcoin_txid *funding_txid, + unsigned int funding_txout, + u64 funding_satoshis, + u64 local_msatoshi, + const u32 feerate_per_kw[NUM_SIDES], + const struct channel_config *local, + const struct channel_config *remote, + const struct basepoints *local_basepoints, + const struct basepoints *remote_basepoints, + const struct pubkey *local_funding_pubkey, + const struct pubkey *remote_funding_pubkey, + enum side funder) { struct channel *channel = new_initial_channel(ctx, funding_txid, funding_txout, diff --git a/channeld/full_channel.h b/channeld/full_channel.h index 7cf121ff7..d76d3b000 100644 --- a/channeld/full_channel.h +++ b/channeld/full_channel.h @@ -7,7 +7,7 @@ #include /** - * new_channel: Given initial fees and funding, what is initial state? + * new_full_channel: Given initial fees and funding, what is initial state? * @ctx: tal context to allocate return value from. * @funding_txid: The commitment transaction id. * @funding_txout: The commitment transaction output number. @@ -25,19 +25,19 @@ * * Returns state, or NULL if malformed. */ -struct channel *new_channel(const tal_t *ctx, - const struct bitcoin_txid *funding_txid, - unsigned int funding_txout, - u64 funding_satoshis, - u64 local_msatoshi, - const u32 feerate_per_kw[NUM_SIDES], - const struct channel_config *local, - const struct channel_config *remote, - const struct basepoints *local_basepoints, - const struct basepoints *remote_basepoints, - const struct pubkey *local_funding_pubkey, - const struct pubkey *remote_funding_pubkey, - enum side funder); +struct channel *new_full_channel(const tal_t *ctx, + const struct bitcoin_txid *funding_txid, + unsigned int funding_txout, + u64 funding_satoshis, + u64 local_msatoshi, + const u32 feerate_per_kw[NUM_SIDES], + const struct channel_config *local, + const struct channel_config *remote, + const struct basepoints *local_basepoints, + const struct basepoints *remote_basepoints, + const struct pubkey *local_funding_pubkey, + const struct pubkey *remote_funding_pubkey, + enum side funder); /** * channel_txs: Get the current commitment and htlc txs for the channel. diff --git a/channeld/test/run-full_channel.c b/channeld/test/run-full_channel.c index aff2c3929..e9ca5a8cb 100644 --- a/channeld/test/run-full_channel.c +++ b/channeld/test/run-full_channel.c @@ -443,22 +443,24 @@ int main(void) to_local_msat = 7000000000; to_remote_msat = 3000000000; feerate_per_kw[LOCAL] = feerate_per_kw[REMOTE] = 15000; - lchannel = new_channel(tmpctx, &funding_txid, funding_output_index, - funding_amount_satoshi, to_local_msat, - feerate_per_kw, - local_config, - remote_config, - &localbase, &remotebase, - &local_funding_pubkey, &remote_funding_pubkey, - LOCAL); - rchannel = new_channel(tmpctx, &funding_txid, funding_output_index, - funding_amount_satoshi, to_remote_msat, - feerate_per_kw, - remote_config, - local_config, - &remotebase, &localbase, - &remote_funding_pubkey, &local_funding_pubkey, - REMOTE); + lchannel = new_full_channel(tmpctx, &funding_txid, funding_output_index, + funding_amount_satoshi, to_local_msat, + feerate_per_kw, + local_config, + remote_config, + &localbase, &remotebase, + &local_funding_pubkey, + &remote_funding_pubkey, + LOCAL); + rchannel = new_full_channel(tmpctx, &funding_txid, funding_output_index, + funding_amount_satoshi, to_remote_msat, + feerate_per_kw, + remote_config, + local_config, + &remotebase, &localbase, + &remote_funding_pubkey, + &local_funding_pubkey, + REMOTE); /* BOLT #3: *