mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
daemon: dev-mocktime command
Useful for precise timing control for testing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "controlled_time.h"
|
||||
#include "log.h"
|
||||
#include "pseudorand.h"
|
||||
#include <ccan/array_size/array_size.h>
|
||||
@@ -102,7 +103,7 @@ struct log_record *new_log_record(const tal_t *ctx,
|
||||
lr->max_mem = max_mem;
|
||||
lr->print = log_default_print;
|
||||
lr->print_level = printlevel;
|
||||
lr->init_time = time_now();
|
||||
lr->init_time = controlled_time();
|
||||
list_head_init(&lr->log);
|
||||
|
||||
return lr;
|
||||
@@ -183,7 +184,7 @@ static struct log_entry *new_log_entry(struct log *log, enum log_level level)
|
||||
{
|
||||
struct log_entry *l = tal(log->lr, struct log_entry);
|
||||
|
||||
l->time = time_now();
|
||||
l->time = controlled_time();
|
||||
l->level = level;
|
||||
l->skipped = 0;
|
||||
l->prefix = log->prefix;
|
||||
|
||||
Reference in New Issue
Block a user