Fix range proof deser (length issue)
This commit is contained in:
+4
-4
@@ -37,7 +37,7 @@ use util::secp::constants::{
|
||||
SECRET_KEY_SIZE,
|
||||
};
|
||||
|
||||
const BULLET_PROOF_SIZE:usize = 674;
|
||||
const BULLET_PROOF_SIZE: usize = 674;
|
||||
|
||||
/// Possible errors deriving from serializing or deserializing.
|
||||
#[derive(Debug)]
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user