projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1449 from TheBlueMatt/2022-04-fix-remote_ip_race
[rust-lightning]
/
lightning
/
src
/
util
/
ser.rs
diff --git
a/lightning/src/util/ser.rs
b/lightning/src/util/ser.rs
index 8fb72a8f9fe643f56cfc259e5b7214b56a4fb761..de12d8506f8d2da87becade08ac82514e30dc6d0 100644
(file)
--- a/
lightning/src/util/ser.rs
+++ b/
lightning/src/util/ser.rs
@@
-174,6
+174,7
@@
pub trait Writeable {
}
/// Writes self out to a Vec<u8>
}
/// Writes self out to a Vec<u8>
+ #[cfg(test)]
fn encode_with_len(&self) -> Vec<u8> {
let mut msg = VecWriter(Vec::new());
0u16.write(&mut msg).unwrap();
fn encode_with_len(&self) -> Vec<u8> {
let mut msg = VecWriter(Vec::new());
0u16.write(&mut msg).unwrap();
@@
-475,10
+476,9
@@
macro_rules! impl_array {
);
}
);
}
-//TODO: performance issue with [u8; size] with impl_array!()
impl_array!(3); // for rgb
impl_array!(4); // for IPv4
impl_array!(3); // for rgb
impl_array!(4); // for IPv4
-impl_array!(1
0
); // for OnionV2
+impl_array!(1
2
); // for OnionV2
impl_array!(16); // for IPv6
impl_array!(32); // for channel id & hmac
impl_array!(PUBLIC_KEY_SIZE); // for PublicKey
impl_array!(16); // for IPv6
impl_array!(32); // for channel id & hmac
impl_array!(PUBLIC_KEY_SIZE); // for PublicKey