Skip to content

Commit

Permalink
Remove .expect()s for block and transaction, they might fail for writ…
Browse files Browse the repository at this point in the history
…er reasons
  • Loading branch information
dconnolly committed Oct 10, 2019
1 parent e1f2eaa commit dc18e8f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions zebra-network/src/protocol/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,7 @@ impl Codec {
ref block,
} => {
writer.write_u32::<LittleEndian>(version.0)?;
block
.zcash_serialize(&mut writer)
.expect("Blocks must serialize.");
block.zcash_serialize(&mut writer)?
}
GetBlocks {
ref version,
Expand Down Expand Up @@ -268,9 +266,7 @@ impl Codec {
ref transaction,
} => {
writer.write_u32::<LittleEndian>(version.0)?;
transaction
.zcash_serialize(&mut writer)
.expect("Transactions must serialize.");
transaction.zcash_serialize(&mut writer)?
}
// Mempool => {}
// FilterLoad => {}
Expand Down

0 comments on commit dc18e8f

Please sign in to comment.