Trace the decoded message in the decoder.

This commit is contained in:
Henry de Valence 2019-09-24 16:14:50 -07:00
parent 47e304ed9a
commit 2796a1a56b
1 changed files with 6 additions and 2 deletions

View File

@ -308,8 +308,12 @@ impl Decoder for Codec {
b"merkleblock\0" => self.read_merkleblock(body_reader),
_ => bail!("unknown command"),
}
// We need Ok(Some(msg)) to signal that we're done decoding
.map(|msg| Some(msg))
// We need Ok(Some(msg)) to signal that we're done decoding.
// This is also convenient for tracing the parse result.
.map(|msg| {
trace!(?msg);
Some(msg)
})
}
}
}