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

Function offer_status_in_db

wallet/wallet.h:1463–1489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1461};
1462
1463static inline enum offer_status offer_status_in_db(enum offer_status s)
1464{
1465 switch (s) {
1466 case OFFER_MULTIPLE_USE_UNUSED:
1467 BUILD_ASSERT(OFFER_MULTIPLE_USE_UNUSED == 1);
1468 return s;
1469 case OFFER_MULTIPLE_USE_USED:
1470 BUILD_ASSERT(OFFER_MULTIPLE_USE_USED == 5);
1471 return s;
1472 case OFFER_SINGLE_USE_UNUSED:
1473 BUILD_ASSERT(OFFER_SINGLE_USE_UNUSED == 3);
1474 return s;
1475 case OFFER_SINGLE_USE_USED:
1476 BUILD_ASSERT(OFFER_SINGLE_USE_USED == 6);
1477 return s;
1478 case OFFER_SINGLE_DISABLED:
1479 BUILD_ASSERT(OFFER_SINGLE_DISABLED == 2);
1480 return s;
1481 case OFFER_MULTIPLE_USED_DISABLED:
1482 BUILD_ASSERT(OFFER_MULTIPLE_USED_DISABLED == 4);
1483 return s;
1484 case OFFER_MULTIPLE_DISABLED:
1485 BUILD_ASSERT(OFFER_MULTIPLE_DISABLED == 0);
1486 return s;
1487 }
1488 fatal("%s: %u is invalid", __func__, s);
1489}
1490
1491static inline bool offer_status_active(enum offer_status s)
1492{

Callers 5

wallet_offer_createFunction · 0.85
wallet_offer_findFunction · 0.85
offer_status_updateFunction · 0.85
wallet_offer_disableFunction · 0.85
wallet_offer_mark_usedFunction · 0.85

Calls 1

fatalFunction · 0.50

Tested by

no test coverage detected