Fix range proof deser (length issue)
@@ -364,13 +364,13 @@ impl Readable for Identifier {
impl Writeable for RangeProof {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error> {
- writer.write_fixed_bytes(self)
+ writer.write_bytes(self)
}
}
impl Readable for RangeProof {
fn read(reader: &mut Reader) -> Result<RangeProof, Error> {
- let p = try!(reader.read_limited_vec(BULLET_PROOF_SIZE));
+ let p = reader.read_limited_vec(BULLET_PROOF_SIZE)?;
let mut a = [0; MAX_PROOF_SIZE];
for i in 0..p.len() {
a[i] = p[i];
@@ -384,7 +384,7 @@ impl Readable for RangeProof {
impl PMMRable for RangeProof {
fn len() -> usize {
- BULLET_PROOF_SIZE
+ BULLET_PROOF_SIZE + 8
}
}
