projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support option_data_loss_protect for remote peer
[rust-lightning]
/
src
/
ln
/
msgs.rs
diff --git
a/src/ln/msgs.rs
b/src/ln/msgs.rs
index f6968c5d3a32dfd4b0b20915ee5db02839943efb..0e6c4b95ee32645d4e43a5ead08331e99d4784f6 100644
(file)
--- a/
src/ln/msgs.rs
+++ b/
src/ln/msgs.rs
@@
-63,23
+63,19
@@
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 << 5],
+ flags: vec![
2 |
1 << 5],
}
}
#[cfg(feature = "fuzztarget")]
pub fn new() -> LocalFeatures {
LocalFeatures {
}
}
#[cfg(feature = "fuzztarget")]
pub fn new() -> LocalFeatures {
LocalFeatures {
- flags: vec![1 << 5],
+ flags: vec![
2 |
1 << 5],
}
}
pub(crate) fn supports_data_loss_protect(&self) -> bool {
self.flags.len() > 0 && (self.flags[0] & 3) != 0
}
}
}
pub(crate) fn supports_data_loss_protect(&self) -> bool {
self.flags.len() > 0 && (self.flags[0] & 3) != 0
}
- pub(crate) fn requires_data_loss_protect(&self) -> bool {
- self.flags.len() > 0 && (self.flags[0] & 1) != 0
- }
-
pub(crate) fn initial_routing_sync(&self) -> bool {
self.flags.len() > 0 && (self.flags[0] & (1 << 3)) != 0
}
pub(crate) fn initial_routing_sync(&self) -> bool {
self.flags.len() > 0 && (self.flags[0] & (1 << 3)) != 0
}
@@
-2018,9
+2014,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("00012
8
").unwrap());
+ target_value.append(&mut hex::decode("00012
a
").unwrap());
} else {
} else {
- target_value.append(&mut hex::decode("00012
0
").unwrap());
+ target_value.append(&mut hex::decode("00012
2
").unwrap());
}
assert_eq!(encoded_value, target_value);
}
}
assert_eq!(encoded_value, target_value);
}