diff --git a/p2p/src/msg.rs b/p2p/src/msg.rs index 32752ff6..6b836da8 100644 --- a/p2p/src/msg.rs +++ b/p2p/src/msg.rs @@ -626,15 +626,8 @@ impl Writeable for Ping { impl Readable for Ping { fn read(reader: &mut Reader) -> Result { - // TODO - once everyone is sending total_difficulty we can clean this up - let total_difficulty = match Difficulty::read(reader) { - Ok(diff) => diff, - Err(_) => Difficulty::zero(), - }; - let height = match reader.read_u64() { - Ok(h) => h, - Err(_) => 0, - }; + let total_difficulty = Difficulty::read(reader)?; + let height = reader.read_u64()?; Ok(Ping { total_difficulty, height, @@ -660,15 +653,8 @@ impl Writeable for Pong { impl Readable for Pong { fn read(reader: &mut Reader) -> Result { - // TODO - once everyone is sending total_difficulty we can clean this up - let total_difficulty = match Difficulty::read(reader) { - Ok(diff) => diff, - Err(_) => Difficulty::zero(), - }; - let height = match reader.read_u64() { - Ok(h) => h, - Err(_) => 0, - }; + let total_difficulty = Difficulty::read(reader)?; + let height = reader.read_u64()?; Ok(Pong { total_difficulty, height,