Skip to content

Commit e49f738

Browse files
config: add max_funding_satoshis to enforce for inbound channels
and a bonus grammar fix
1 parent fa59544 commit e49f738

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lightning/src/util/config.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//! Various user-configurable channel limits and settings which ChannelManager
1111
//! applies for you.
1212
13+
use ln::channel::MAX_FUNDING_SATOSHIS_NO_WUMBO;
1314
use ln::channelmanager::{BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT};
1415

1516
/// Configuration we set when applicable.
@@ -95,11 +96,16 @@ impl Default for ChannelHandshakeConfig {
9596
/// are applied mostly only to incoming channels that's not much of a problem.
9697
#[derive(Copy, Clone, Debug)]
9798
pub struct ChannelHandshakeLimits {
98-
/// Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
99+
/// Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
99100
/// only applies to inbound channels.
100101
///
101102
/// Default value: 0.
102103
pub min_funding_satoshis: u64,
104+
/// Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
105+
/// only applies to inbound channels.
106+
///
107+
/// Default value: 2^24 - 1.
108+
pub max_funding_satoshis: u64,
103109
/// The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
104110
/// you to limit the maximum minimum-size they can require.
105111
///
@@ -151,6 +157,7 @@ impl Default for ChannelHandshakeLimits {
151157
fn default() -> Self {
152158
ChannelHandshakeLimits {
153159
min_funding_satoshis: 0,
160+
max_funding_satoshis: MAX_FUNDING_SATOSHIS_NO_WUMBO,
154161
max_htlc_minimum_msat: <u64>::max_value(),
155162
min_max_htlc_value_in_flight_msat: 0,
156163
max_channel_reserve_satoshis: <u64>::max_value(),

0 commit comments

Comments
 (0)