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

Function forward_style_in_db

wallet/wallet.h:143–157  ·  view source on GitHub ↗

Wrapper to ensure types don't change, and we don't insert/extract * invalid ones from db */

Source from the content-addressed store, hash-verified

141/* Wrapper to ensure types don't change, and we don't insert/extract
142 * invalid ones from db */
143static inline enum forward_style forward_style_in_db(enum forward_style o)
144{
145 switch (o) {
146 case FORWARD_STYLE_LEGACY:
147 BUILD_ASSERT(FORWARD_STYLE_LEGACY == 0);
148 return o;
149 case FORWARD_STYLE_TLV:
150 BUILD_ASSERT(FORWARD_STYLE_TLV == 1);
151 return o;
152 case FORWARD_STYLE_UNKNOWN:
153 /* Not recorded in DB! */
154 break;
155 }
156 fatal("%s: %u is invalid", __func__, o);
157}
158
159/* DB wrapper to check htlc_state */
160static inline enum htlc_state htlc_state_in_db(enum htlc_state s)

Callers 3

forwarding_detailsFunction · 0.85

Calls 1

fatalFunction · 0.50

Tested by

no test coverage detected