Skip to content

Commit

Permalink
Add feerate_per_kw_range on three default policies
Browse files Browse the repository at this point in the history
Add max_htlc_value_in_flight_msat_min default value to lnd policy
  • Loading branch information
grunch committed Jan 3, 2022
1 parent 2264592 commit 5ae5869
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/channel/bolt/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,7 @@ impl Policy {
pub fn with_clightning_defaults() -> Policy {
Policy {
to_self_delay_max: 14 * 24 * 6,
// I don't know what is the normal operational range for c-lightning
// but I only see values way more than 100 in examples like this
// https://github.com/ElementsProject/lightning/blob/335ef3fb69f923f6f30213f68881d10ee6d977ed/doc/PLUGINS.md#openchannel
// or tests like this https://github.com/ElementsProject/lightning/blob/master/tests/test_wallet.py#L594
//feerate_per_kw_range: 1..100,
feerate_per_kw_range: 1..1000,
minimum_depth: 3,
maximum_depth: Some(6),
funding_satoshis_min: Some(10000),
Expand All @@ -244,23 +240,19 @@ impl Policy {
pub fn with_lnd_defaults() -> Policy {
Policy {
to_self_delay_max: 14 * 24 * 6,
// I am not sure if this is the correct range for LND, even is the correct minimum
// I don't find the maximum value
// https://github.com/lightningnetwork/lnd/blob/master/lnwallet/chainfee/rates.go#L13
// feerate_per_kw_range: 253..?,
feerate_per_kw_range: 1..1000,
minimum_depth: 3,
maximum_depth: Some(6),
funding_satoshis_min: Some(20000),
htlc_minimum_msat_max: None,
// Can't find the maximum value for this
// max_htlc_value_in_flight_msat_min: Some(10000),
max_htlc_value_in_flight_msat_min: Some(10000),
max_accepted_htlcs_min: Some(483),
channel_reserve_satoshis_max_abs: None,
// LND uses 1% of the channel funding as a reserve
channel_reserve_satoshis_max_percent: Some(1),
// Since LND 0.13.3 there is no default value for dust limit
// DustLimitForSize retrieves the dust limit for a given pkscript size
// 546 is the biggest value for p2pkh
// DustLimitForSize retrieves the dust limit for a given pkscript
// size 546 is the biggest value for p2pkh
// https://github.com/lightningnetwork/lnd/pull/5781
dust_limit_satoshis_max: Some(546),
}
Expand All @@ -270,8 +262,7 @@ impl Policy {
pub fn with_eclair_defaults() -> Policy {
Policy {
to_self_delay_max: 14 * 24 * 6,
// Same doubts as with LND and c-lightning about feerate_per_kw_range
//feerate_per_kw_range: 1..100,
feerate_per_kw_range: 1..1000,
minimum_depth: 3,
maximum_depth: Some(6),
funding_satoshis_min: Some(100000),
Expand Down

0 comments on commit 5ae5869

Please sign in to comment.