From 4c3370e02300dac7c80edb6d44164648f3950333 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 24 Mar 2016 12:11:26 +1030 Subject: [PATCH] funding: trivial variable rename "state" is reserved for lightningd_state; use cstate in initial_funding() like everywhere else. Signed-off-by: Rusty Russell --- funding.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/funding.c b/funding.c index 0c1b474e7..e3f00ad71 100644 --- a/funding.c +++ b/funding.c @@ -119,30 +119,30 @@ struct channel_state *initial_funding(const tal_t *ctx, uint64_t anchor_satoshis, uint64_t fee) { - struct channel_state *state = talz(ctx, struct channel_state); + struct channel_state *cstate = talz(ctx, struct channel_state); - state->a.htlcs = tal_arr(state, struct channel_htlc, 0); - state->b.htlcs = tal_arr(state, struct channel_htlc, 0); + cstate->a.htlcs = tal_arr(cstate, struct channel_htlc, 0); + cstate->b.htlcs = tal_arr(cstate, struct channel_htlc, 0); if (fee > anchor_satoshis) - return tal_free(state); + return tal_free(cstate); if (anchor_satoshis > (1ULL << 32) / 1000) - return tal_free(state); + return tal_free(cstate); /* Initially, all goes back to funder. */ - state->a.pay_msat = anchor_satoshis * 1000 - fee * 1000; - state->a.fee_msat = fee * 1000; - state->a.offered_anchor = true; - state->b.offered_anchor = false; + cstate->a.pay_msat = anchor_satoshis * 1000 - fee * 1000; + cstate->a.fee_msat = fee * 1000; + cstate->a.offered_anchor = true; + cstate->b.offered_anchor = false; /* If B (not A) is funder, invert. */ if (!am_funder) - invert_cstate(state); + invert_cstate(cstate); /* Make sure it checks out. */ - assert(funding_delta(anchor_satoshis, 0, 0, &state->a, &state->b)); - return state; + assert(funding_delta(anchor_satoshis, 0, 0, &cstate->a, &cstate->b)); + return cstate; } bool adjust_fee(uint64_t anchor_satoshis,