Browse Source

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>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
350d8edb7e
  1. 6
      daemon/log.c
  2. 2
      daemon/log.h

6
daemon/log.c

@ -29,7 +29,6 @@ struct log_entry {
struct log_record { struct log_record {
size_t mem_used; size_t mem_used;
size_t max_mem; size_t max_mem;
struct lightningd_state *dstate;
void (*print)(const char *prefix, void (*print)(const char *prefix,
enum log_level level, enum log_level level,
bool continued, bool continued,
@ -93,17 +92,16 @@ static size_t prune_log(struct log_record *log)
return deleted; 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, size_t max_mem,
enum log_level printlevel) 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! */ /* Give a reasonable size for memory limit! */
assert(max_mem > sizeof(struct log) * 2); assert(max_mem > sizeof(struct log) * 2);
lr->mem_used = 0; lr->mem_used = 0;
lr->max_mem = max_mem; lr->max_mem = max_mem;
lr->dstate = dstate;
lr->print = log_default_print; lr->print = log_default_print;
lr->print_level = printlevel; lr->print_level = printlevel;
lr->init_time = time_now(); lr->init_time = time_now();

2
daemon/log.h

@ -23,7 +23,7 @@ enum log_level {
}; };
/* We have a single record. */ /* 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, size_t max_mem,
enum log_level printlevel); enum log_level printlevel);

Loading…
Cancel
Save