mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-08 08:34:31 +01:00
common: add logging for peer packets, with status_io.
We log the plaintext, not the encrypted ones. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -15,9 +15,12 @@ bool sync_crypto_write(struct crypto_state *cs, int fd, const void *msg TAKES)
|
||||
bool post_sabotage = false;
|
||||
int type = fromwire_peektype(msg);
|
||||
#endif
|
||||
u8 *enc = cryptomsg_encrypt_msg(NULL, cs, msg);
|
||||
u8 *enc;
|
||||
bool ret;
|
||||
|
||||
status_io(LOG_IO_OUT, msg);
|
||||
enc = cryptomsg_encrypt_msg(NULL, cs, msg);
|
||||
|
||||
#if DEVELOPER
|
||||
switch (dev_disconnect(type)) {
|
||||
case DEV_DISCONNECT_BEFORE:
|
||||
@@ -71,6 +74,7 @@ u8 *sync_crypto_read(const tal_t *ctx, struct crypto_state *cs, int fd)
|
||||
if (!dec)
|
||||
status_trace("Failed body decrypt with rn=%"PRIu64, cs->rn-2);
|
||||
else
|
||||
status_trace("Read decrypt %s", tal_hex(trc, dec));
|
||||
status_io(LOG_IO_IN, dec);
|
||||
|
||||
return dec;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user