core-lightning/common/version.h
Vincenzo Palazzo 8f94e8b943 comm: make sure that our version check is reliable
Rework the logic of the version check used in the
database migration, and make sure
that it is full functional to avoid confusion
at release time.

Changelog-Fixed: database: Correctly identity official release versions for database upgrade.

Reported-by: @urza
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-17 14:15:24 +10:30

18 lines
513 B
C

#ifndef LIGHTNING_COMMON_VERSION_H
#define LIGHTNING_COMMON_VERSION_H
#include "config.h"
#include <stdbool.h>
char *version_and_exit(const void *unused);
const char *version(void);
/* check if the current version is a release version.
*
* Released versions are of form v[year].[month]?(.patch)* */
bool is_released_version(void);
#define opt_register_version() \
opt_register_early_noarg("--version|-V", version_and_exit, NULL, \
"Print version and exit")
#endif /* LIGHTNING_COMMON_VERSION_H */