Skip to content

Commit 092d1c1

Browse files
committed
Add config support for 'their_channel_reserve_proportional_millionths' [#1498]
It is proportion of the channel value to configure as the `their_channel_reserve_satoshis` for both outbound and inbound channels. It decides the minimum balance that the other node has to maintain on their side, at all times.
1 parent f75b6cb commit 092d1c1

File tree

5 files changed

+131
-25
lines changed

5 files changed

+131
-25
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ lightning-c-bindings/a.out
88
Cargo.lock
99
.idea
1010
lightning/target
11+
lightning/ldk-net_graph-*.bin
1112
no-std-check/target
13+

lightning/src/ln/channel.rs

Lines changed: 87 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,9 @@ pub const MAX_CHAN_DUST_LIMIT_SATOSHIS: u64 = MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS
795795
/// See https://github.com/lightning/bolts/issues/905 for more details.
796796
pub const MIN_CHAN_DUST_LIMIT_SATOSHIS: u64 = 354;
797797

798+
// Just a reasonable implementation-specific safe lower bound, higher than the dust limit.
799+
pub const MIN_THEIR_CHAN_RESERVE_SATOSHIS: u64 = 1000;
800+
798801
/// Used to return a simple Error back to ChannelManager. Will get converted to a
799802
/// msgs::ErrorAction::SendErrorMessage or msgs::ErrorAction::IgnoreError as appropriate with our
800803
/// channel_id in ChannelManager.
@@ -843,16 +846,25 @@ impl<Signer: Sign> Channel<Signer> {
843846
}
844847

845848
/// Returns a minimum channel reserve value the remote needs to maintain,
846-
/// required by us.
849+
/// required by us according to the configured or default
850+
/// [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`]
847851
///
848852
/// Guaranteed to return a value no larger than channel_value_satoshis
849853
///
850-
/// This is used both for new channels and to figure out what reserve value we sent to peers
851-
/// for channels serialized before we included our selected reserve value in the serialized
852-
/// data explicitly.
853-
pub(crate) fn get_holder_selected_channel_reserve_satoshis(channel_value_satoshis: u64) -> u64 {
854+
/// This is used both for outbound and inbound channels and has lower bound
855+
/// of `MIN_THEIR_CHAN_RESERVE_SATOSHIS`.
856+
pub(crate) fn get_holder_selected_channel_reserve_satoshis(channel_value_satoshis: u64, config: &UserConfig) -> u64 {
857+
let calculated_reserve = channel_value_satoshis.saturating_mul(config.channel_handshake_config.their_channel_reserve_proportional_millionths as u64) / 1_000_000;
858+
cmp::min(channel_value_satoshis, cmp::max(calculated_reserve, MIN_THEIR_CHAN_RESERVE_SATOSHIS))
859+
}
860+
861+
/// This is for legacy reasons, present for forward-compatibility.
862+
/// LDK versions older than 0.0.104 don't know how read/handle values other than default
863+
/// from storage. Hence, we use this function to not persist default values of
864+
/// `holder_selected_channel_reserve_satoshis` for channels into storage.
865+
pub(crate) fn get_legacy_default_holder_selected_channel_reserve_satoshis(channel_value_satoshis: u64) -> u64 {
854866
let (q, _) = channel_value_satoshis.overflowing_div(100);
855-
cmp::min(channel_value_satoshis, cmp::max(q, 1000)) //TODO
867+
cmp::min(channel_value_satoshis, cmp::max(q, 1000))
856868
}
857869

858870
pub(crate) fn opt_anchors(&self) -> bool {
@@ -912,8 +924,10 @@ impl<Signer: Sign> Channel<Signer> {
912924
if holder_selected_contest_delay < BREAKDOWN_TIMEOUT {
913925
return Err(APIError::APIMisuseError {err: format!("Configured with an unreasonable our_to_self_delay ({}) putting user funds at risks", holder_selected_contest_delay)});
914926
}
915-
let holder_selected_channel_reserve_satoshis = Channel::<Signer>::get_holder_selected_channel_reserve_satoshis(channel_value_satoshis);
927+
let holder_selected_channel_reserve_satoshis = Channel::<Signer>::get_holder_selected_channel_reserve_satoshis(channel_value_satoshis, config);
916928
if holder_selected_channel_reserve_satoshis < MIN_CHAN_DUST_LIMIT_SATOSHIS {
929+
// Protocol level safety check in place, although it should never happen because
930+
// of `MIN_THEIR_CHAN_RESERVE_SATOSHIS`
917931
return Err(APIError::APIMisuseError { err: format!("Holder selected channel reserve below implemention limit dust_limit_satoshis {}", holder_selected_channel_reserve_satoshis) });
918932
}
919933

@@ -1204,12 +1218,14 @@ impl<Signer: Sign> Channel<Signer> {
12041218
}
12051219
}
12061220

1207-
let holder_selected_channel_reserve_satoshis = Channel::<Signer>::get_holder_selected_channel_reserve_satoshis(msg.funding_satoshis);
1221+
let holder_selected_channel_reserve_satoshis = Channel::<Signer>::get_holder_selected_channel_reserve_satoshis(msg.funding_satoshis, config);
12081222
if holder_selected_channel_reserve_satoshis < MIN_CHAN_DUST_LIMIT_SATOSHIS {
1223+
// Protocol level safety check in place, although it should never happen because
1224+
// of `MIN_THEIR_CHAN_RESERVE_SATOSHIS`
12091225
return Err(ChannelError::Close(format!("Suitable channel reserve not found. remote_channel_reserve was ({}). dust_limit_satoshis is ({}).", holder_selected_channel_reserve_satoshis, MIN_CHAN_DUST_LIMIT_SATOSHIS)));
12101226
}
12111227
if holder_selected_channel_reserve_satoshis * 1000 >= full_channel_value_msat {
1212-
return Err(ChannelError::Close(format!("Suitable channel reserve not found. remote_channel_reserve was ({}). Channel value is ({} - {}).", holder_selected_channel_reserve_satoshis, full_channel_value_msat, msg.push_msat)));
1228+
return Err(ChannelError::Close(format!("Suitable channel reserve not found. remote_channel_reserve was ({})msats. Channel value is ({} - {})msats.", holder_selected_channel_reserve_satoshis * 1000, full_channel_value_msat, msg.push_msat)));
12131229
}
12141230
if msg.channel_reserve_satoshis < MIN_CHAN_DUST_LIMIT_SATOSHIS {
12151231
log_debug!(logger, "channel_reserve_satoshis ({}) is smaller than our dust limit ({}). We can broadcast stale states without any risk, implying this channel is very insecure for our counterparty.",
@@ -6106,7 +6122,7 @@ impl<Signer: Sign> Writeable for Channel<Signer> {
61066122
// a different percentage of the channel value then 10%, which older versions of LDK used
61076123
// to set it to before the percentage was made configurable.
61086124
let serialized_holder_selected_reserve =
6109-
if self.holder_selected_channel_reserve_satoshis != Self::get_holder_selected_channel_reserve_satoshis(self.channel_value_satoshis)
6125+
if self.holder_selected_channel_reserve_satoshis != Self::get_legacy_default_holder_selected_channel_reserve_satoshis(self.channel_value_satoshis)
61106126
{ Some(self.holder_selected_channel_reserve_satoshis) } else { None };
61116127

61126128
let mut old_max_in_flight_percent_config = UserConfig::default().channel_handshake_config;
@@ -6381,7 +6397,7 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<(&'a K, u32)> for Channel<Signer>
63816397
let mut announcement_sigs = None;
63826398
let mut target_closing_feerate_sats_per_kw = None;
63836399
let mut monitor_pending_finalized_fulfills = Some(Vec::new());
6384-
let mut holder_selected_channel_reserve_satoshis = Some(Self::get_holder_selected_channel_reserve_satoshis(channel_value_satoshis));
6400+
let mut holder_selected_channel_reserve_satoshis = Some(Self::get_legacy_default_holder_selected_channel_reserve_satoshis(channel_value_satoshis));
63856401
let mut holder_max_htlc_value_in_flight_msat = Some(Self::get_holder_max_htlc_value_in_flight_msat(channel_value_satoshis, &UserConfig::default().channel_handshake_config));
63866402
// Prior to supporting channel type negotiation, all of our channels were static_remotekey
63876403
// only, so we default to that if none was written.
@@ -6561,6 +6577,7 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<(&'a K, u32)> for Channel<Signer>
65616577

65626578
#[cfg(test)]
65636579
mod tests {
6580+
use std::cmp;
65646581
use bitcoin::blockdata::script::{Script, Builder};
65656582
use bitcoin::blockdata::transaction::{Transaction, TxOut};
65666583
use bitcoin::blockdata::constants::genesis_block;
@@ -6570,7 +6587,7 @@ mod tests {
65706587
use ln::PaymentHash;
65716588
use ln::channelmanager::{HTLCSource, PaymentId};
65726589
use ln::channel::{Channel, InboundHTLCOutput, OutboundHTLCOutput, InboundHTLCState, OutboundHTLCState, HTLCCandidate, HTLCInitiator};
6573-
use ln::channel::{MAX_FUNDING_SATOSHIS_NO_WUMBO, TOTAL_BITCOIN_SUPPLY_SATOSHIS};
6590+
use ln::channel::{MAX_FUNDING_SATOSHIS_NO_WUMBO, TOTAL_BITCOIN_SUPPLY_SATOSHIS, MIN_THEIR_CHAN_RESERVE_SATOSHIS};
65746591
use ln::features::{InitFeatures, ChannelTypeFeatures};
65756592
use ln::msgs::{ChannelUpdate, DataLossProtect, DecodeError, OptionalField, UnsignedChannelUpdate};
65766593
use ln::script::ShutdownScript;
@@ -6962,6 +6979,64 @@ mod tests {
69626979
assert_eq!(chan_8.holder_max_htlc_value_in_flight_msat, chan_8_value_msat);
69636980
}
69646981

6982+
#[test]
6983+
fn test_configured_holder_selected_channel_reserve_satoshis() {
6984+
6985+
// Test that `new_outbound` and `new_from_req` create a channel with the correct
6986+
// channel reserves, when `their_channel_reserve_proportional_millionths` is configured.
6987+
test_self_and_counterparty_channel_reserve(10_000_000, 0.02, 0.02);
6988+
6989+
// Test with valid but unreasonably high channel reserves
6990+
// Requesting and accepting parties have requested for 49%-49% and 60%-30% channel reserve
6991+
test_self_and_counterparty_channel_reserve(10_000_000, 0.49, 0.49);
6992+
test_self_and_counterparty_channel_reserve(10_000_000, 0.60, 0.30);
6993+
6994+
// Test with calculated channel reserve less than lower bound
6995+
// i.e `MIN_THEIR_CHAN_RESERVE_SATOSHIS`
6996+
test_self_and_counterparty_channel_reserve(100_000, 0.00002, 0.30);
6997+
6998+
// Test with invalid channel reserves since sum of both is greater than or equal
6999+
// to channel value
7000+
test_self_and_counterparty_channel_reserve(10_000_000, 0.50, 0.50);
7001+
test_self_and_counterparty_channel_reserve(10_000_000, 0.60, 0.50);
7002+
}
7003+
7004+
fn test_self_and_counterparty_channel_reserve(channel_value_satoshis: u64, outbound_selected_channel_reserve_perc: f64, inbound_selected_channel_reserve_perc: f64) {
7005+
let fee_est = LowerBoundedFeeEstimator::new(&TestFeeEstimator { fee_est: 15_000 });
7006+
let logger = test_utils::TestLogger::new();
7007+
let secp_ctx = Secp256k1::new();
7008+
let seed = [42; 32];
7009+
let network = Network::Testnet;
7010+
let keys_provider = test_utils::TestKeysInterface::new(&seed, network);
7011+
let outbound_node_id = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
7012+
let inbound_node_id = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[7; 32]).unwrap());
7013+
7014+
7015+
let mut outbound_node_config = UserConfig::default();
7016+
outbound_node_config.channel_handshake_config.their_channel_reserve_proportional_millionths = (outbound_selected_channel_reserve_perc * 1_000_000.0) as u32;
7017+
let chan = Channel::<EnforcingSigner>::new_outbound(&&fee_est, &&keys_provider, outbound_node_id, &InitFeatures::known(), channel_value_satoshis, 100_000, 42, &outbound_node_config, 0, 42).unwrap();
7018+
7019+
let expected_outbound_selected_chan_reserve = cmp::max(MIN_THEIR_CHAN_RESERVE_SATOSHIS, (chan.channel_value_satoshis as f64 * outbound_selected_channel_reserve_perc) as u64);
7020+
assert_eq!(chan.holder_selected_channel_reserve_satoshis, expected_outbound_selected_chan_reserve);
7021+
7022+
let chan_open_channel_msg = chan.get_open_channel(genesis_block(network).header.block_hash());
7023+
let mut inbound_node_config = UserConfig::default();
7024+
inbound_node_config.channel_handshake_config.their_channel_reserve_proportional_millionths = (inbound_selected_channel_reserve_perc * 1_000_000.0) as u32;
7025+
7026+
if outbound_selected_channel_reserve_perc + inbound_selected_channel_reserve_perc < 1.0 {
7027+
let chan_inbound_node = Channel::<EnforcingSigner>::new_from_req(&&fee_est, &&keys_provider, inbound_node_id, &InitFeatures::known(), &chan_open_channel_msg, 7, &inbound_node_config, 0, &&logger, 42).unwrap();
7028+
7029+
let expected_inbound_selected_chan_reserve = cmp::max(MIN_THEIR_CHAN_RESERVE_SATOSHIS, (chan.channel_value_satoshis as f64 * inbound_selected_channel_reserve_perc) as u64);
7030+
7031+
assert_eq!(chan_inbound_node.holder_selected_channel_reserve_satoshis, expected_inbound_selected_chan_reserve);
7032+
assert_eq!(chan_inbound_node.counterparty_selected_channel_reserve_satoshis.unwrap(), expected_outbound_selected_chan_reserve);
7033+
} else {
7034+
// Channel Negotiations failed
7035+
let result = Channel::<EnforcingSigner>::new_from_req(&&fee_est, &&keys_provider, inbound_node_id, &InitFeatures::known(), &chan_open_channel_msg, 7, &inbound_node_config, 0, &&logger, 42);
7036+
assert!(result.is_err());
7037+
}
7038+
}
7039+
69657040
#[test]
69667041
fn channel_update() {
69677042
let feeest = LowerBoundedFeeEstimator::new(&TestFeeEstimator{fee_est: 15000});

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
16351635
}
16361636
}
16371637

1638-
/// Gets the current configuration applied to all new channels, as
1638+
/// Gets the current configuration applied to all new channels.
16391639
pub fn get_current_default_configuration(&self) -> &UserConfig {
16401640
&self.default_configuration
16411641
}

lightning/src/ln/functional_tests.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn test_insane_channel_opens() {
7373
// Instantiate channel parameters where we push the maximum msats given our
7474
// funding satoshis
7575
let channel_value_sat = 31337; // same as funding satoshis
76-
let channel_reserve_satoshis = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(channel_value_sat);
76+
let channel_reserve_satoshis = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(channel_value_sat, &cfg);
7777
let push_msat = (channel_value_sat - channel_reserve_satoshis) * 1000;
7878

7979
// Have node0 initiate a channel to node1 with aforementioned parameters
@@ -148,13 +148,14 @@ fn do_test_counterparty_no_reserve(send_from_initiator: bool) {
148148
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
149149
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
150150
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
151+
let default_config = UserConfig::default();
151152

152153
// Have node0 initiate a channel to node1 with aforementioned parameters
153154
let mut push_amt = 100_000_000;
154155
let feerate_per_kw = 253;
155156
let opt_anchors = false;
156157
push_amt -= feerate_per_kw as u64 * (commitment_tx_base_weight(opt_anchors) + 4 * COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000 * 1000;
157-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
158+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
158159

159160
let temp_channel_id = nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100_000, if send_from_initiator { 0 } else { push_amt }, 42, None).unwrap();
160161
let mut open_channel_message = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
@@ -633,7 +634,8 @@ fn test_update_fee_that_funder_cannot_afford() {
633634
let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, channel_value, push_sats * 1000, InitFeatures::known(), InitFeatures::known());
634635
let channel_id = chan.2;
635636
let secp_ctx = Secp256k1::new();
636-
let bs_channel_reserve_sats = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(channel_value);
637+
let default_config = UserConfig::default();
638+
let bs_channel_reserve_sats = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(channel_value, &default_config);
637639

638640
let opt_anchors = false;
639641

@@ -1520,12 +1522,13 @@ fn test_chan_reserve_violation_outbound_htlc_inbound_chan() {
15201522
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
15211523
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
15221524
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1523-
1525+
let default_config = UserConfig::default();
15241526
let opt_anchors = false;
15251527

15261528
let mut push_amt = 100_000_000;
15271529
push_amt -= commit_tx_fee_msat(feerate_per_kw, MIN_AFFORDABLE_HTLC_COUNT as u64, opt_anchors);
1528-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1530+
1531+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
15291532

15301533
let _ = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100_000, push_amt, InitFeatures::known(), InitFeatures::known());
15311534

@@ -1549,15 +1552,15 @@ fn test_chan_reserve_violation_inbound_htlc_outbound_channel() {
15491552
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
15501553
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
15511554
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1552-
1555+
let default_config = UserConfig::default();
15531556
let opt_anchors = false;
15541557

15551558
// Set nodes[0]'s balance such that they will consider any above-dust received HTLC to be a
15561559
// channel reserve violation (so their balance is channel reserve (1000 sats) + commitment
15571560
// transaction fee with 0 HTLCs (183 sats)).
15581561
let mut push_amt = 100_000_000;
15591562
push_amt -= commit_tx_fee_msat(feerate_per_kw, MIN_AFFORDABLE_HTLC_COUNT as u64, opt_anchors);
1560-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1563+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
15611564
let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100_000, push_amt, InitFeatures::known(), InitFeatures::known());
15621565

15631566
// Send four HTLCs to cover the initial push_msat buffer we're required to include
@@ -1602,15 +1605,15 @@ fn test_chan_reserve_dust_inbound_htlcs_outbound_chan() {
16021605
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
16031606
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None, None]);
16041607
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1605-
1608+
let default_config = UserConfig::default();
16061609
let opt_anchors = false;
16071610

16081611
// Set nodes[0]'s balance such that they will consider any above-dust received HTLC to be a
16091612
// channel reserve violation (so their balance is channel reserve (1000 sats) + commitment
16101613
// transaction fee with 0 HTLCs (183 sats)).
16111614
let mut push_amt = 100_000_000;
16121615
push_amt -= commit_tx_fee_msat(feerate_per_kw, MIN_AFFORDABLE_HTLC_COUNT as u64, opt_anchors);
1613-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1616+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
16141617
create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100000, push_amt, InitFeatures::known(), InitFeatures::known());
16151618

16161619
let dust_amt = crate::ln::channel::MIN_CHAN_DUST_LIMIT_SATOSHIS * 1000
@@ -1640,7 +1643,7 @@ fn test_chan_init_feerate_unaffordability() {
16401643
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
16411644
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
16421645
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1643-
1646+
let default_config = UserConfig::default();
16441647
let opt_anchors = false;
16451648

16461649
// Set the push_msat amount such that nodes[0] will not be able to afford to add even a single
@@ -1652,7 +1655,7 @@ fn test_chan_init_feerate_unaffordability() {
16521655

16531656
// During open, we don't have a "counterparty channel reserve" to check against, so that
16541657
// requirement only comes into play on the open_channel handling side.
1655-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1658+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
16561659
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100_000, push_amt, 42, None).unwrap();
16571660
let mut open_channel_msg = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
16581661
open_channel_msg.push_msat += 1;
@@ -1771,10 +1774,11 @@ fn test_inbound_outbound_capacity_is_not_zero() {
17711774
let _ = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100000, 95000000, InitFeatures::known(), InitFeatures::known());
17721775
let channels0 = node_chanmgrs[0].list_channels();
17731776
let channels1 = node_chanmgrs[1].list_channels();
1777+
let default_config = UserConfig::default();
17741778
assert_eq!(channels0.len(), 1);
17751779
assert_eq!(channels1.len(), 1);
17761780

1777-
let reserve = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100000);
1781+
let reserve = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config);
17781782
assert_eq!(channels0[0].inbound_capacity_msat, 95000000 - reserve*1000);
17791783
assert_eq!(channels1[0].outbound_capacity_msat, 95000000 - reserve*1000);
17801784

0 commit comments

Comments
 (0)