Remove old code/comment.

This commit is contained in:
Gav Wood 2016-06-07 12:30:35 -07:00
parent 2abe8cc5dd
commit 5397da0c93

View File

@ -38,23 +38,7 @@ pub struct Block {
impl Block { impl Block {
/// Returns true if the given bytes form a valid encoding of a block in RLP. /// Returns true if the given bytes form a valid encoding of a block in RLP.
// TODO: implement Decoder for this and have this use that.
pub fn is_good(b: &[u8]) -> bool { pub fn is_good(b: &[u8]) -> bool {
/*
let urlp = UntrustedRlp::new(&b);
if !urlp.is_list() || urlp.item_count() != 3 || urlp.size() != b.len() { return false; }
if urlp.val_at::<Header>(0).is_err() { return false; }
if !urlp.at(1).unwrap().is_list() { return false; }
if urlp.at(1).unwrap().iter().find(|i| i.as_val::<Transaction>().is_err()).is_some() {
return false;
}
if !urlp.at(2).unwrap().is_list() { return false; }
if urlp.at(2).unwrap().iter().find(|i| i.as_val::<Header>().is_err()).is_some() {
return false;
}
true*/
UntrustedRlp::new(b).as_val::<Block>().is_ok() UntrustedRlp::new(b).as_val::<Block>().is_ok()
} }
} }