projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not require upfront_shutdown as the security gain is marginal
[rust-lightning]
/
src
/
ln
/
msgs.rs
diff --git
a/src/ln/msgs.rs
b/src/ln/msgs.rs
index a27b896701412918886d3c890074f03fdfe5f64a..f6968c5d3a32dfd4b0b20915ee5db02839943efb 100644
(file)
--- a/
src/ln/msgs.rs
+++ b/
src/ln/msgs.rs
@@
-63,13
+63,13
@@
impl LocalFeatures {
#[cfg(not(feature = "fuzztarget"))]
pub(crate) fn new() -> LocalFeatures {
LocalFeatures {
#[cfg(not(feature = "fuzztarget"))]
pub(crate) fn new() -> LocalFeatures {
LocalFeatures {
- flags: vec![1 <<
4
],
+ flags: vec![1 <<
5
],
}
}
#[cfg(feature = "fuzztarget")]
pub fn new() -> LocalFeatures {
LocalFeatures {
}
}
#[cfg(feature = "fuzztarget")]
pub fn new() -> LocalFeatures {
LocalFeatures {
- flags: vec![1 <<
4
],
+ flags: vec![1 <<
5
],
}
}
}
}
@@
-94,8
+94,9
@@
impl LocalFeatures {
pub(crate) fn supports_upfront_shutdown_script(&self) -> bool {
self.flags.len() > 0 && (self.flags[0] & (3 << 4)) != 0
}
pub(crate) fn supports_upfront_shutdown_script(&self) -> bool {
self.flags.len() > 0 && (self.flags[0] & (3 << 4)) != 0
}
+ #[cfg(test)]
pub(crate) fn unset_upfront_shutdown_script(&mut self) {
pub(crate) fn unset_upfront_shutdown_script(&mut self) {
- self.flags[0] ^= 1 <<
4
;
+ self.flags[0] ^= 1 <<
5
;
}
pub(crate) fn requires_unknown_bits(&self) -> bool {
}
pub(crate) fn requires_unknown_bits(&self) -> bool {
@@
-2017,9
+2018,9
@@
mod tests {
target_value.append(&mut hex::decode("0000").unwrap());
}
if initial_routing_sync {
target_value.append(&mut hex::decode("0000").unwrap());
}
if initial_routing_sync {
- target_value.append(&mut hex::decode("0001
1
8").unwrap());
+ target_value.append(&mut hex::decode("0001
2
8").unwrap());
} else {
} else {
- target_value.append(&mut hex::decode("0001
1
0").unwrap());
+ target_value.append(&mut hex::decode("0001
2
0").unwrap());
}
assert_eq!(encoded_value, target_value);
}
}
assert_eq!(encoded_value, target_value);
}