wallet: have db track what columns are accessed in DEVELOPER mode.

And add db_col_ignore helper for cases where it's deliberate.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-11-15 04:30:46 +10:30
parent 7382616513
commit c462ccae1a
5 changed files with 138 additions and 11 deletions

View File

@@ -3,6 +3,7 @@
#include "config.h"
#include <ccan/list/list.h>
#include <ccan/short_types/short_types.h>
#include <ccan/strset/strset.h>
#include <common/autodata.h>
/* For testing, we want to catch fatal messages. */
@@ -99,6 +100,11 @@ struct db_stmt {
bool executed;
int row;
#if DEVELOPER
/* Map as we reference into a SELECT statement in query. */
struct strset *cols_used;
#endif
};
struct db_config {