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

Function forward_style_in_db

wallet/wallet.h:174–188  ·  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

172/* Wrapper to ensure types don't change, and we don't insert/extract
173 * invalid ones from db */
174static inline enum forward_style forward_style_in_db(enum forward_style o)
175{
176 switch (o) {
177 case FORWARD_STYLE_LEGACY:
178 BUILD_ASSERT(FORWARD_STYLE_LEGACY == 0);
179 return o;
180 case FORWARD_STYLE_TLV:
181 BUILD_ASSERT(FORWARD_STYLE_TLV == 1);
182 return o;
183 case FORWARD_STYLE_UNKNOWN:
184 /* Not recorded in DB! */
185 break;
186 }
187 fatal("%s: %u is invalid", __func__, o);
188}
189
190static inline const char *forward_style_name(enum forward_style style)
191{

Calls 1

fatalFunction · 0.50

Tested by

no test coverage detected