Skip to content

Commit f37cbfe

Browse files
committed
Set channel reserve to 0 for full withdrawal
Set min_their_channel_reserve_satoshis to 0 in channel handshake config to allow clients to fully withdraw channel funds over lightning. Updated rust-lightning dependency to version with configurable minimum channel reserve support.
1 parent 7dc77cc commit f37cbfe

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ default = []
3939
# lightning-transaction-sync = { version = "0.1.0", features = ["esplora-async-https", "time", "electrum"] }
4040
# lightning-liquidity = { version = "0.1.0", features = ["std"] }
4141

42-
# Branch: https://github.com/moneydevkit/rust-lightning/commits/lsp-0.1.8/
43-
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std"] }
44-
lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" }
45-
lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std"] }
46-
lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" }
47-
lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" }
48-
lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["futures"] }
49-
lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" }
50-
lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["rpc-client", "tokio"] }
51-
lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["esplora-async-https", "time", "electrum"] }
52-
lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std"] }
42+
# Branch: https://github.com/moneydevkit/rust-lightning/commits/austin/mdk-189/configurable-min-channel-reserve/
43+
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std"] }
44+
lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" }
45+
lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std"] }
46+
lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" }
47+
lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" }
48+
lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["futures"] }
49+
lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" }
50+
lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["rpc-client", "tokio"] }
51+
lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["esplora-async-https", "time", "electrum"] }
52+
lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std"] }
5353

5454
#lightning = { path = "../rust-lightning/lightning", features = ["std"] }
5555
#lightning-types = { path = "../rust-lightning/lightning-types" }
@@ -100,7 +100,7 @@ winapi = { version = "0.3", features = ["winbase"] }
100100
[dev-dependencies]
101101
# lightning = { version = "0.1.0", features = ["std", "_test_utils"] }
102102
# Branch: https://github.com/moneydevkit/rust-lightning/commits/lsp-0.1.8/
103-
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std", "_test_utils"] }
103+
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std", "_test_utils"] }
104104
#lightning = { path = "../rust-lightning/lightning", features = ["std", "_test_utils"] }
105105
proptest = "1.0.0"
106106
regex = "1.5.6"

src/liquidity.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ where
795795
// TODO: revisit this decision eventually.
796796
config.channel_config.forwarding_fee_base_msat = 0;
797797
config.channel_config.forwarding_fee_proportional_millionths = 0;
798+
config.channel_handshake_config.min_their_channel_reserve_satoshis = 0;
798799

799800
match self.channel_manager.create_channel(
800801
their_network_key,
@@ -1079,6 +1080,7 @@ where
10791080
// TODO: revisit this decision eventually.
10801081
config.channel_config.forwarding_fee_base_msat = 0;
10811082
config.channel_config.forwarding_fee_proportional_millionths = 0;
1083+
config.channel_handshake_config.min_their_channel_reserve_satoshis = 0;
10821084

10831085
// TODO: does LSPS4 service need to track this? seems like no?
10841086
let user_channel_id = 0;

0 commit comments

Comments
 (0)