Skip to content

Commit 1b04904

Browse files
committed
Set channel reserve to 0 for full withdrawal (#1)
Set both min_their_channel_reserve_satoshis and their_channel_reserve_proportional_millionths to 0 in channel handshake config for JIT channels. Both settings are required: - min_their_channel_reserve_satoshis: minimum absolute reserve - their_channel_reserve_proportional_millionths: proportional reserve Updated rust-lightning dependency to version with configurable minimum channel reserve support.
1 parent ec8c62e commit 1b04904

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ default = []
4040
# lightning-liquidity = { version = "0.1.0", features = ["std"] }
4141

4242
# Branch: https://github.com/moneydevkit/rust-lightning/commits/lsp-0.1.8_accept-underpaying-htlcs/
43-
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f", features = ["std"] }
44-
lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f" }
45-
lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f", features = ["std"] }
46-
lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f" }
47-
lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f" }
48-
lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f", features = ["futures"] }
49-
lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f" }
50-
lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f", features = ["rpc-client", "tokio"] }
51-
lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f", features = ["esplora-async-https", "time", "electrum"] }
52-
lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f", features = ["std"] }
43+
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310", features = ["std"] }
44+
lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310" }
45+
lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310", features = ["std"] }
46+
lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310" }
47+
lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310" }
48+
lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310", features = ["futures"] }
49+
lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310" }
50+
lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310", features = ["rpc-client", "tokio"] }
51+
lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310", features = ["esplora-async-https", "time", "electrum"] }
52+
lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310", 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_accept-underpaying-htlcs/
103-
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "42bad4fd3c908958b96b6b70ed63bd6aa3cbaf5f", features = ["std", "_test_utils"] }
103+
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "490192370412ee4289940e90281a9c2b504ea310", 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,8 @@ 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;
799+
config.channel_handshake_config.their_channel_reserve_proportional_millionths = 0;
798800

799801
match self.channel_manager.create_channel(
800802
their_network_key,
@@ -1079,6 +1081,8 @@ where
10791081
// TODO: revisit this decision eventually.
10801082
config.channel_config.forwarding_fee_base_msat = 0;
10811083
config.channel_config.forwarding_fee_proportional_millionths = 0;
1084+
config.channel_handshake_config.min_their_channel_reserve_satoshis = 0;
1085+
config.channel_handshake_config.their_channel_reserve_proportional_millionths = 0;
10821086

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

0 commit comments

Comments
 (0)