mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
log: don't include dstate any more.
Before we had a global secp256k1_ctx we needed to hold this to print out pubkeys, now it's completely orthogonal. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
07fbeee29d
commit
350d8edb7e
@ -29,7 +29,6 @@ struct log_entry {
|
||||
struct log_record {
|
||||
size_t mem_used;
|
||||
size_t max_mem;
|
||||
struct lightningd_state *dstate;
|
||||
void (*print)(const char *prefix,
|
||||
enum log_level level,
|
||||
bool continued,
|
||||
@ -93,17 +92,16 @@ static size_t prune_log(struct log_record *log)
|
||||
return deleted;
|
||||
}
|
||||
|
||||
struct log_record *new_log_record(struct lightningd_state *dstate,
|
||||
struct log_record *new_log_record(const tal_t *ctx,
|
||||
size_t max_mem,
|
||||
enum log_level printlevel)
|
||||
{
|
||||
struct log_record *lr = tal(dstate, struct log_record);
|
||||
struct log_record *lr = tal(ctx, struct log_record);
|
||||
|
||||
/* Give a reasonable size for memory limit! */
|
||||
assert(max_mem > sizeof(struct log) * 2);
|
||||
lr->mem_used = 0;
|
||||
lr->max_mem = max_mem;
|
||||
lr->dstate = dstate;
|
||||
lr->print = log_default_print;
|
||||
lr->print_level = printlevel;
|
||||
lr->init_time = time_now();
|
||||
|
@ -23,7 +23,7 @@ enum log_level {
|
||||
};
|
||||
|
||||
/* We have a single record. */
|
||||
struct log_record *new_log_record(struct lightningd_state *dstate,
|
||||
struct log_record *new_log_record(const tal_t *ctx,
|
||||
size_t max_mem,
|
||||
enum log_level printlevel);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user