Skip to content

Commit 736c0b9

Browse files
authored
Merge pull request #1619 from G8XSU/main
Add config support for 'their_channel_reserve_proportional_millionths' [#1498]
2 parents 28c9b56 + 092d1c1 commit 736c0b9

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.",
@@ -6107,7 +6123,7 @@ impl<Signer: Sign> Writeable for Channel<Signer> {
61076123
// a different percentage of the channel value then 10%, which older versions of LDK used
61086124
// to set it to before the percentage was made configurable.
61096125
let serialized_holder_selected_reserve =
6110-
if self.holder_selected_channel_reserve_satoshis != Self::get_holder_selected_channel_reserve_satoshis(self.channel_value_satoshis)
6126+
if self.holder_selected_channel_reserve_satoshis != Self::get_legacy_default_holder_selected_channel_reserve_satoshis(self.channel_value_satoshis)
61116127
{ Some(self.holder_selected_channel_reserve_satoshis) } else { None };
61126128

61136129
let mut old_max_in_flight_percent_config = UserConfig::default().channel_handshake_config;
@@ -6382,7 +6398,7 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<(&'a K, u32)> for Channel<Signer>
63826398
let mut announcement_sigs = None;
63836399
let mut target_closing_feerate_sats_per_kw = None;
63846400
let mut monitor_pending_finalized_fulfills = Some(Vec::new());
6385-
let mut holder_selected_channel_reserve_satoshis = Some(Self::get_holder_selected_channel_reserve_satoshis(channel_value_satoshis));
6401+
let mut holder_selected_channel_reserve_satoshis = Some(Self::get_legacy_default_holder_selected_channel_reserve_satoshis(channel_value_satoshis));
63866402
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));
63876403
// Prior to supporting channel type negotiation, all of our channels were static_remotekey
63886404
// only, so we default to that if none was written.
@@ -6562,6 +6578,7 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<(&'a K, u32)> for Channel<Signer>
65626578

65636579
#[cfg(test)]
65646580
mod tests {
6581+
use std::cmp;
65656582
use bitcoin::blockdata::script::{Script, Builder};
65666583
use bitcoin::blockdata::transaction::{Transaction, TxOut};
65676584
use bitcoin::blockdata::constants::genesis_block;
@@ -6571,7 +6588,7 @@ mod tests {
65716588
use ln::PaymentHash;
65726589
use ln::channelmanager::{HTLCSource, PaymentId};
65736590
use ln::channel::{Channel, InboundHTLCOutput, OutboundHTLCOutput, InboundHTLCState, OutboundHTLCState, HTLCCandidate, HTLCInitiator};
6574-
use ln::channel::{MAX_FUNDING_SATOSHIS_NO_WUMBO, TOTAL_BITCOIN_SUPPLY_SATOSHIS};
6591+
use ln::channel::{MAX_FUNDING_SATOSHIS_NO_WUMBO, TOTAL_BITCOIN_SUPPLY_SATOSHIS, MIN_THEIR_CHAN_RESERVE_SATOSHIS};
65756592
use ln::features::{InitFeatures, ChannelTypeFeatures};
65766593
use ln::msgs::{ChannelUpdate, DataLossProtect, DecodeError, OptionalField, UnsignedChannelUpdate, MAX_VALUE_MSAT};
65776594
use ln::script::ShutdownScript;
@@ -6965,6 +6982,64 @@ mod tests {
69656982
assert_eq!(chan_8.holder_max_htlc_value_in_flight_msat, chan_8_value_msat);
69666983
}
69676984

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

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

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

160161
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();
161162
let mut open_channel_message = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
@@ -634,7 +635,8 @@ fn test_update_fee_that_funder_cannot_afford() {
634635
let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, channel_value, push_sats * 1000, InitFeatures::known(), InitFeatures::known());
635636
let channel_id = chan.2;
636637
let secp_ctx = Secp256k1::new();
637-
let bs_channel_reserve_sats = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(channel_value);
638+
let default_config = UserConfig::default();
639+
let bs_channel_reserve_sats = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(channel_value, &default_config);
638640

639641
let opt_anchors = false;
640642

@@ -1498,12 +1500,13 @@ fn test_chan_reserve_violation_outbound_htlc_inbound_chan() {
14981500
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
14991501
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
15001502
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1501-
1503+
let default_config = UserConfig::default();
15021504
let opt_anchors = false;
15031505

15041506
let mut push_amt = 100_000_000;
15051507
push_amt -= commit_tx_fee_msat(feerate_per_kw, MIN_AFFORDABLE_HTLC_COUNT as u64, opt_anchors);
1506-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1508+
1509+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
15071510

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

@@ -1527,15 +1530,15 @@ fn test_chan_reserve_violation_inbound_htlc_outbound_channel() {
15271530
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
15281531
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
15291532
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1530-
1533+
let default_config = UserConfig::default();
15311534
let opt_anchors = false;
15321535

15331536
// Set nodes[0]'s balance such that they will consider any above-dust received HTLC to be a
15341537
// channel reserve violation (so their balance is channel reserve (1000 sats) + commitment
15351538
// transaction fee with 0 HTLCs (183 sats)).
15361539
let mut push_amt = 100_000_000;
15371540
push_amt -= commit_tx_fee_msat(feerate_per_kw, MIN_AFFORDABLE_HTLC_COUNT as u64, opt_anchors);
1538-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1541+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
15391542
let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100_000, push_amt, InitFeatures::known(), InitFeatures::known());
15401543

15411544
// Send four HTLCs to cover the initial push_msat buffer we're required to include
@@ -1580,15 +1583,15 @@ fn test_chan_reserve_dust_inbound_htlcs_outbound_chan() {
15801583
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
15811584
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None, None]);
15821585
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1583-
1586+
let default_config = UserConfig::default();
15841587
let opt_anchors = false;
15851588

15861589
// Set nodes[0]'s balance such that they will consider any above-dust received HTLC to be a
15871590
// channel reserve violation (so their balance is channel reserve (1000 sats) + commitment
15881591
// transaction fee with 0 HTLCs (183 sats)).
15891592
let mut push_amt = 100_000_000;
15901593
push_amt -= commit_tx_fee_msat(feerate_per_kw, MIN_AFFORDABLE_HTLC_COUNT as u64, opt_anchors);
1591-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1594+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
15921595
create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100000, push_amt, InitFeatures::known(), InitFeatures::known());
15931596

15941597
let dust_amt = crate::ln::channel::MIN_CHAN_DUST_LIMIT_SATOSHIS * 1000
@@ -1618,7 +1621,7 @@ fn test_chan_init_feerate_unaffordability() {
16181621
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
16191622
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
16201623
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
1621-
1624+
let default_config = UserConfig::default();
16221625
let opt_anchors = false;
16231626

16241627
// Set the push_msat amount such that nodes[0] will not be able to afford to add even a single
@@ -1630,7 +1633,7 @@ fn test_chan_init_feerate_unaffordability() {
16301633

16311634
// During open, we don't have a "counterparty channel reserve" to check against, so that
16321635
// requirement only comes into play on the open_channel handling side.
1633-
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000) * 1000;
1636+
push_amt -= Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config) * 1000;
16341637
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 100_000, push_amt, 42, None).unwrap();
16351638
let mut open_channel_msg = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
16361639
open_channel_msg.push_msat += 1;
@@ -1749,10 +1752,11 @@ fn test_inbound_outbound_capacity_is_not_zero() {
17491752
let _ = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100000, 95000000, InitFeatures::known(), InitFeatures::known());
17501753
let channels0 = node_chanmgrs[0].list_channels();
17511754
let channels1 = node_chanmgrs[1].list_channels();
1755+
let default_config = UserConfig::default();
17521756
assert_eq!(channels0.len(), 1);
17531757
assert_eq!(channels1.len(), 1);
17541758

1755-
let reserve = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100000);
1759+
let reserve = Channel::<EnforcingSigner>::get_holder_selected_channel_reserve_satoshis(100_000, &default_config);
17561760
assert_eq!(channels0[0].inbound_capacity_msat, 95000000 - reserve*1000);
17571761
assert_eq!(channels1[0].outbound_capacity_msat, 95000000 - reserve*1000);
17581762

0 commit comments

Comments
 (0)