From f37cbfe630fd1f41fdd2b1a826305805a2a736ae Mon Sep 17 00:00:00 2001 From: amackillop Date: Mon, 15 Dec 2025 08:24:33 -0800 Subject: [PATCH] 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. --- Cargo.toml | 24 ++++++++++++------------ src/liquidity.rs | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c86da47ce..ed0450cd9 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,17 +39,17 @@ default = [] # lightning-transaction-sync = { version = "0.1.0", features = ["esplora-async-https", "time", "electrum"] } # lightning-liquidity = { version = "0.1.0", features = ["std"] } -# Branch: https://github.com/moneydevkit/rust-lightning/commits/lsp-0.1.8/ -lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std"] } -lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" } -lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" } -lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" } -lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["futures"] } -lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c" } -lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["esplora-async-https", "time", "electrum"] } -lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std"] } +# Branch: https://github.com/moneydevkit/rust-lightning/commits/austin/mdk-189/configurable-min-channel-reserve/ +lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std"] } +lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" } +lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" } +lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" } +lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["futures"] } +lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e" } +lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["esplora-async-https", "time", "electrum"] } +lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std"] } #lightning = { path = "../rust-lightning/lightning", features = ["std"] } #lightning-types = { path = "../rust-lightning/lightning-types" } @@ -100,7 +100,7 @@ winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] # lightning = { version = "0.1.0", features = ["std", "_test_utils"] } # Branch: https://github.com/moneydevkit/rust-lightning/commits/lsp-0.1.8/ -lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "5fe3688fd19705e8f4ad33dc4d00ee32c157433c", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "52603a9c4179cb849191571964eeadcb451cb33e", features = ["std", "_test_utils"] } #lightning = { path = "../rust-lightning/lightning", features = ["std", "_test_utils"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/liquidity.rs b/src/liquidity.rs index 13bb01fc9..1c9bb72bf 100644 --- a/src/liquidity.rs +++ b/src/liquidity.rs @@ -795,6 +795,7 @@ where // TODO: revisit this decision eventually. config.channel_config.forwarding_fee_base_msat = 0; config.channel_config.forwarding_fee_proportional_millionths = 0; + config.channel_handshake_config.min_their_channel_reserve_satoshis = 0; match self.channel_manager.create_channel( their_network_key, @@ -1079,6 +1080,7 @@ where // TODO: revisit this decision eventually. config.channel_config.forwarding_fee_base_msat = 0; config.channel_config.forwarding_fee_proportional_millionths = 0; + config.channel_handshake_config.min_their_channel_reserve_satoshis = 0; // TODO: does LSPS4 service need to track this? seems like no? let user_channel_id = 0;