Add DEVELOPER flag, set by default.

This is a bit messier than I'd like, but we want to clearly remove all
dev code (not just have it uncalled), so we remove fields and functions
altogether rather than stub them out.  This means we put #ifdefs in callers
in some places, but at least it's explicit.

We still run tests, but only a subset, and we run with NO_VALGRIND under
Travis to avoid increasing test times too much.

See-also: #176
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-10-24 12:36:14 +10:30
committed by Christian Decker
parent 8d9818ff9c
commit 3c6eec87e3
21 changed files with 301 additions and 168 deletions

View File

@@ -114,18 +114,6 @@ struct lightningd {
/* Our chain topology. */
struct chain_topology *topology;
/* If we want to debug a subdaemon. */
const char *dev_debug_subdaemon;
/* If we want to set a specific non-random HSM seed. */
const u8 *dev_hsm_seed;
/* If we have a --dev-disconnect file */
int dev_disconnect_fd;
/* If we have --dev-fail-on-subdaemon-fail */
bool dev_subdaemon_fail;
/* HTLCs in flight. */
struct htlc_in_map htlcs_in;
struct htlc_out_map htlcs_out;
@@ -139,6 +127,20 @@ struct lightningd {
/* Any outstanding "pay" commands. */
struct list_head pay_commands;
#if DEVELOPER
/* If we want to debug a subdaemon. */
const char *dev_debug_subdaemon;
/* If we want to set a specific non-random HSM seed. */
const u8 *dev_hsm_seed;
/* If we have a --dev-disconnect file */
int dev_disconnect_fd;
/* If we have --dev-fail-on-subdaemon-fail */
bool dev_subdaemon_fail;
#endif /* DEVELOPER */
};
/**