Skip to content

Commit 2873ca6

Browse files
committed
Nine tenths are always bigger than one thents
As `get_holder_max_htlc_value_in_flight_msat` is a thents of `self.channel_value_satoshis`, there is no need to compute the minimum.
1 parent e23c270 commit 2873ca6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lightning/src/ln/channel.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,14 +3328,7 @@ impl<Signer: Sign> Channel<Signer> {
33283328

33293329
/// Allowed in any state (including after shutdown)
33303330
pub fn get_announced_htlc_max_msat(&self) -> u64 {
3331-
return cmp::min(
3332-
// Upper bound by capacity. We make it a bit less than full capacity to prevent attempts
3333-
// to use full capacity. This is an effort to reduce routing failures, because in many cases
3334-
// channel might have been used to route very small values (either by honest users or as DoS).
3335-
self.channel_value_satoshis * 1000 * 9 / 10,
3336-
3337-
Channel::<Signer>::get_holder_max_htlc_value_in_flight_msat(self.channel_value_satoshis)
3338-
);
3331+
Channel::<Signer>::get_holder_max_htlc_value_in_flight_msat(self.channel_value_satoshis)
33393332
}
33403333

33413334
/// Allowed in any state (including after shutdown)

0 commit comments

Comments
 (0)