lightningd: fix logging of peer death.

We used level -1 to mean "append to log", but that doesn't actually
work, and results in an assert if we try to prune the logs:

	lightningd: daemon/pseudorand.c:36: pseudorand: Assertion `max' failed.

Expose logv_add and use that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-06-20 10:09:17 +09:30
parent 5b1d60839a
commit 9327aa1df4
3 changed files with 4 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ void peer_fail(struct peer *peer, const char *fmt, ...)
va_start(ap, fmt);
log_info(peer->log, "Peer failure in %s: ",
peer_state_name(peer->state));
logv(peer->log, -1, fmt, ap);
logv_add(peer->log, fmt, ap);
va_end(ap);
/* If we haven't reached awaiting locked, we don't need to reconnect */