MCPcopy Create free account
hub / github.com/ElementsProject/lightning / inc_fee_state

Function inc_fee_state

common/fee_states.c:104–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104bool inc_fee_state(struct fee_states *fee_states, enum htlc_state hstate)
105{
106 /* These only advance through ADDING states. */
107 assert(htlc_state_flags(hstate) & HTLC_ADDING);
108
109 if (!fee_states->feerate[hstate])
110 return false;
111
112 /* FIXME: We can never clash, except at final state unless someone
113 * has violated protocol (eg, send two revoke_and_ack back-to-back) */
114 tal_free(fee_states->feerate[hstate+1]);
115 fee_states->feerate[hstate+1] = fee_states->feerate[hstate];
116 fee_states->feerate[hstate] = NULL;
117 return true;
118}
119
120struct fee_states *fromwire_fee_states(const tal_t *ctx,
121 const u8 **cursor, size_t *max)

Callers 1

fee_incstateFunction · 0.85

Calls 2

tal_freeFunction · 0.85
htlc_state_flagsFunction · 0.70

Tested by

no test coverage detected