Skip to content

Commit 4e81d8d

Browse files
authored
Merge pull request #362 from TheBlueMatt/2019-07-no-bogus-sec-required
Do not require upfront_shutdown as the security gain is marginal
2 parents 07e927c + c05e087 commit 4e81d8d

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/ln/msgs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ impl LocalFeatures {
6363
#[cfg(not(feature = "fuzztarget"))]
6464
pub(crate) fn new() -> LocalFeatures {
6565
LocalFeatures {
66-
flags: vec![1 << 4],
66+
flags: vec![1 << 5],
6767
}
6868
}
6969
#[cfg(feature = "fuzztarget")]
7070
pub fn new() -> LocalFeatures {
7171
LocalFeatures {
72-
flags: vec![1 << 4],
72+
flags: vec![1 << 5],
7373
}
7474
}
7575

@@ -96,7 +96,7 @@ impl LocalFeatures {
9696
}
9797
#[cfg(test)]
9898
pub(crate) fn unset_upfront_shutdown_script(&mut self) {
99-
self.flags[0] ^= 1 << 4;
99+
self.flags[0] ^= 1 << 5;
100100
}
101101

102102
pub(crate) fn requires_unknown_bits(&self) -> bool {
@@ -2018,9 +2018,9 @@ mod tests {
20182018
target_value.append(&mut hex::decode("0000").unwrap());
20192019
}
20202020
if initial_routing_sync {
2021-
target_value.append(&mut hex::decode("000118").unwrap());
2021+
target_value.append(&mut hex::decode("000128").unwrap());
20222022
} else {
2023-
target_value.append(&mut hex::decode("000110").unwrap());
2023+
target_value.append(&mut hex::decode("000120").unwrap());
20242024
}
20252025
assert_eq!(encoded_value, target_value);
20262026
}

src/util/config.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@ pub struct ChannelConfig {
152152
///
153153
/// This cannot be changed after the initial channel handshake.
154154
pub announced_channel: bool,
155-
/// Set to commit to an upfront shutdown_pubkey at channel opening. In case of mutual
156-
/// closing, the other peer will check that our closing transction output is encumbered
157-
/// by the provided script.
155+
/// When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
156+
/// supports it, they will then enforce the mutual-close output to us matches what we provided
157+
/// at intialization, preventing us from closing to an alternate pubkey.
158158
///
159-
/// We set it by default as this ensure greater security to the user funds.
159+
/// This is set to true by default to provide a slight increase in security, though ultimately
160+
/// any attacker who is able to take control of a channel can just as easily send the funds via
161+
/// lightning payments, so we never require that our counterparties support this option.
160162
///
161-
/// This cannot be changed after channel opening.
163+
/// This cannot be changed after a channel has been initialized.
162164
pub commit_upfront_shutdown_pubkey: bool
163165
}
164166

0 commit comments

Comments
 (0)