Skip to content

Commit

Permalink
Trace the decoded message in the decoder.
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Sep 24, 2019
1 parent 47e304e commit 2796a1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions zebra-network/src/protocol/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
}
}
Expand Down

0 comments on commit 2796a1a

Please sign in to comment.