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

Function get_feerate

common/fee_states.c:56–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56u32 get_feerate(const struct fee_states *fee_states,
57 enum side opener,
58 enum side side)
59{
60 /* The first non-NULL feerate committed to this side is current */
61 for (enum htlc_state i = first_fee_state(opener);
62 i <= last_fee_state(opener);
63 i++) {
64 if (!fee_states->feerate[i])
65 continue;
66 if (!(htlc_state_flags(i) & HTLC_FLAG(side, HTLC_F_COMMITTED)))
67 continue;
68 return *fee_states->feerate[i];
69 }
70
71 /* Some feerate should always be set! */
72 abort();
73}
74
75/* Are feerates all agreed by both sides? */
76bool feerate_changes_done(const struct fee_states *fee_states,

Callers 1

channel_feerateFunction · 0.70

Calls 4

first_fee_stateFunction · 0.85
last_fee_stateFunction · 0.85
abortFunction · 0.85
htlc_state_flagsFunction · 0.70

Tested by

no test coverage detected