Skip to content

Commit 21d17ed

Browse files
amackillopFernando Ledesma
authored andcommitted
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 2d5be7a commit 21d17ed

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ default = []
4242
# lightning-macros = { version = "0.2.0" }
4343

4444
# Branch: https://github.com/moneydevkit/rust-lightning/commits/lsp-0.2.0/
45-
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472", features = ["std"] }
46-
lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472" }
47-
lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472", features = ["std"] }
48-
lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472" }
49-
lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472", features = ["tokio"] }
50-
lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472" }
51-
lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472" }
52-
lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472", features = ["rest-client", "rpc-client", "tokio"] }
53-
lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
54-
lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472", features = ["std"] }
55-
lightning-macros = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472" }
45+
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891", features = ["std"] }
46+
lightning-types = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891" }
47+
lightning-invoice = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891", features = ["std"] }
48+
lightning-net-tokio = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891" }
49+
lightning-persister = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891", features = ["tokio"] }
50+
lightning-background-processor = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891" }
51+
lightning-rapid-gossip-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891" }
52+
lightning-block-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891", features = ["rest-client", "rpc-client", "tokio"] }
53+
lightning-transaction-sync = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
54+
lightning-liquidity = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891", features = ["std"] }
55+
lightning-macros = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891" }
5656

5757
#lightning = { path = "../rust-lightning/lightning", features = ["std"] }
5858
#lightning-types = { path = "../rust-lightning/lightning-types" }
@@ -99,7 +99,7 @@ winapi = { version = "0.3", features = ["winbase"] }
9999
[dev-dependencies]
100100
# lightning = { version = "0.2.0", features = ["std", "_test_utils"] }
101101
# Branch: https://github.com/moneydevkit/rust-lightning/commits/lsp-0.2.0/
102-
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "1c1755faadfce8ae7f452874722a0866af7df472", features = ["std", "_test_utils"] }
102+
lightning = { git = "https://github.com/moneydevkit/rust-lightning", rev = "f1ac8f14a1de542a08d02bd2132d31da216ce891", features = ["std", "_test_utils"] }
103103
#lightning = { path = "../rust-lightning/lightning", features = ["std", "_test_utils"] }
104104
proptest = "1.0.0"
105105
regex = "1.5.6"

src/liquidity.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,8 @@ where
886886
// TODO: revisit this decision eventually.
887887
config.channel_config.forwarding_fee_base_msat = 0;
888888
config.channel_config.forwarding_fee_proportional_millionths = 0;
889+
config.channel_handshake_config.min_their_channel_reserve_satoshis = 0;
890+
config.channel_handshake_config.their_channel_reserve_proportional_millionths = 0;
889891

890892
match self.channel_manager.create_channel(
891893
their_network_key,
@@ -1171,6 +1173,8 @@ where
11711173
// TODO: revisit this decision eventually.
11721174
config.channel_config.forwarding_fee_base_msat = 0;
11731175
config.channel_config.forwarding_fee_proportional_millionths = 0;
1176+
config.channel_handshake_config.min_their_channel_reserve_satoshis = 0;
1177+
config.channel_handshake_config.their_channel_reserve_proportional_millionths = 0;
11741178

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

0 commit comments

Comments
 (0)