Skip to content

Commit c977def

Browse files
authored
Merge pull request #2191 from TheBlueMatt/2023-04-fix-bucket-deser
Fix deserialization of u16 arrays
2 parents ac004a9 + 7775356 commit c977def

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/util/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ impl Readable for [u16; 8] {
596596
r.read_exact(&mut buf)?;
597597
let mut res = [0u16; 8];
598598
for (idx, v) in res.iter_mut().enumerate() {
599-
*v = (buf[idx] as u16) << 8 | (buf[idx + 1] as u16)
599+
*v = (buf[idx*2] as u16) << 8 | (buf[idx*2 + 1] as u16)
600600
}
601601
Ok(res)
602602
}

0 commit comments

Comments
 (0)