Skip to content

Commit 293bcee

Browse files
authored
Merge pull request #106 from TheBlueMatt/main
0.0.109.0
2 parents 47cbd09 + 81799d1 commit 293bcee

File tree

369 files changed

+8162
-1249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+8162
-1249
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
# Note this is a different endpoint, as we need one non-upstream commit!
4040
git clone https://git.bitcoin.ninja/rust-lightning
4141
cd rust-lightning
42-
git checkout origin/2022-06-108-java-bindings
42+
git checkout origin/2022-07-109-java-bindings
4343
cd ..
4444
git clone https://github.com/lightningdevkit/ldk-c-bindings
4545
cd ldk-c-bindings
46-
git checkout 0.0.108
46+
git checkout 0.0.109
4747
- name: Rebuild C bindings without STD
4848
run: |
4949
cd ldk-c-bindings
@@ -129,11 +129,11 @@ jobs:
129129
# Note this is a different endpoint, as we need one non-upstream commit!
130130
git clone https://git.bitcoin.ninja/rust-lightning
131131
cd rust-lightning
132-
git checkout origin/2022-06-108-java-bindings
132+
git checkout origin/2022-07-109-java-bindings
133133
cd ..
134134
git clone https://github.com/lightningdevkit/ldk-c-bindings
135135
cd ldk-c-bindings
136-
git checkout 0.0.108
136+
git checkout 0.0.109
137137
- name: Rebuild C bindings, and check the sample app builds + links
138138
run: |
139139
cd ldk-c-bindings
@@ -184,11 +184,11 @@ jobs:
184184
# Note this is a different endpoint, as we need one non-upstream commit!
185185
git clone https://git.bitcoin.ninja/rust-lightning
186186
cd rust-lightning
187-
git checkout origin/2022-06-108-java-bindings
187+
git checkout origin/2022-07-109-java-bindings
188188
cd ..
189189
git clone https://github.com/lightningdevkit/ldk-c-bindings
190190
cd ldk-c-bindings
191-
git checkout 0.0.108
191+
git checkout 0.0.109
192192
- name: Rebuild C bindings, and check the sample app builds + links
193193
run: |
194194
cd ldk-c-bindings
@@ -287,11 +287,11 @@ jobs:
287287
# Note this is a different endpoint, as we need one non-upstream commit!
288288
git clone https://git.bitcoin.ninja/rust-lightning
289289
cd rust-lightning
290-
git checkout origin/2022-06-108-java-bindings
290+
git checkout origin/2022-07-109-java-bindings
291291
cd ..
292292
git clone https://github.com/lightningdevkit/ldk-c-bindings
293293
cd ldk-c-bindings
294-
git checkout 0.0.108
294+
git checkout 0.0.109
295295
- name: Checkout Android AAR binaries and artifacts
296296
run: |
297297
# Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
@@ -367,11 +367,11 @@ jobs:
367367
# Note this is a different endpoint, as we need one non-upstream commit!
368368
git clone https://git.bitcoin.ninja/rust-lightning
369369
cd rust-lightning
370-
git checkout origin/2022-06-108-java-bindings
370+
git checkout origin/2022-07-109-java-bindings
371371
cd ..
372372
git clone https://github.com/lightningdevkit/ldk-c-bindings
373373
cd ldk-c-bindings
374-
git checkout 0.0.108
374+
git checkout 0.0.109
375375
- name: Rebuild C bindings with upstream clang, and check the sample app builds + links
376376
run: |
377377
export PATH=`pwd`/clang+llvm-14.0.5-x86_64-apple-darwin/bin:$PATH

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A release build of the Java bindings library for Linux is available in git. Thus
1414

1515
To build the bindings locally, the bindings require some additional work which is still making its
1616
way upstream, for now it should be built against the
17-
[rust-lightning 2021-03-java-bindings-base branch on git.bitcoin.ninja](https://git.bitcoin.ninja/?p=rust-lightning;a=shortlog;h=refs/heads/2021-03-java-bindings-base).
17+
[rust-lightning 2022-07-109-java-bindings branch on git.bitcoin.ninja](https://git.bitcoin.ninja/?p=rust-lightning;a=shortlog;h=refs/heads/2022-07-109-java-bindings).
1818
Check that branch out locally as well as [ldk-c-bindings](https://github.com/lightningdevkit/ldk-c-bindings)
1919
and run the `genbindings.sh` script in ldk-c-bindings to build the required binaries. Thereafter,
2020
in this repo, run the `genbindings.sh` script with the first argument pointing to the ldk-c-bindings

src/main/java/org/ldk/impl/bindings.java

Lines changed: 143 additions & 45 deletions
Large diffs are not rendered by default.

src/main/java/org/ldk/structs/BackgroundProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected void finalize() throws Throwable {
7676
*
7777
* # Rapid Gossip Sync
7878
*
79-
* If rapid gossip sync is meant to run at startup, pass a [`RapidGossipSync`] to `gossip_sync`
79+
* If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
8080
* to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
8181
* until the [`RapidGossipSync`] instance completes its first sync.
8282
*

src/main/java/org/ldk/structs/ChannelConfig.java

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -143,82 +143,6 @@ public void set_cltv_expiry_delta(short val) {
143143
Reference.reachabilityFence(val);
144144
}
145145

146-
/**
147-
* Set to announce the channel publicly and notify all nodes that they can route via this
148-
* channel.
149-
*
150-
* This should only be set to true for nodes which expect to be online reliably.
151-
*
152-
* As the node which funds a channel picks this value this will only apply for new outbound
153-
* channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
154-
*
155-
* This cannot be changed after the initial channel handshake.
156-
*
157-
* Default value: false.
158-
*/
159-
public boolean get_announced_channel() {
160-
boolean ret = bindings.ChannelConfig_get_announced_channel(this.ptr);
161-
Reference.reachabilityFence(this);
162-
return ret;
163-
}
164-
165-
/**
166-
* Set to announce the channel publicly and notify all nodes that they can route via this
167-
* channel.
168-
*
169-
* This should only be set to true for nodes which expect to be online reliably.
170-
*
171-
* As the node which funds a channel picks this value this will only apply for new outbound
172-
* channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
173-
*
174-
* This cannot be changed after the initial channel handshake.
175-
*
176-
* Default value: false.
177-
*/
178-
public void set_announced_channel(boolean val) {
179-
bindings.ChannelConfig_set_announced_channel(this.ptr, val);
180-
Reference.reachabilityFence(this);
181-
Reference.reachabilityFence(val);
182-
}
183-
184-
/**
185-
* When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
186-
* supports it, they will then enforce the mutual-close output to us matches what we provided
187-
* at intialization, preventing us from closing to an alternate pubkey.
188-
*
189-
* This is set to true by default to provide a slight increase in security, though ultimately
190-
* any attacker who is able to take control of a channel can just as easily send the funds via
191-
* lightning payments, so we never require that our counterparties support this option.
192-
*
193-
* This cannot be changed after a channel has been initialized.
194-
*
195-
* Default value: true.
196-
*/
197-
public boolean get_commit_upfront_shutdown_pubkey() {
198-
boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this.ptr);
199-
Reference.reachabilityFence(this);
200-
return ret;
201-
}
202-
203-
/**
204-
* When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
205-
* supports it, they will then enforce the mutual-close output to us matches what we provided
206-
* at intialization, preventing us from closing to an alternate pubkey.
207-
*
208-
* This is set to true by default to provide a slight increase in security, though ultimately
209-
* any attacker who is able to take control of a channel can just as easily send the funds via
210-
* lightning payments, so we never require that our counterparties support this option.
211-
*
212-
* This cannot be changed after a channel has been initialized.
213-
*
214-
* Default value: true.
215-
*/
216-
public void set_commit_upfront_shutdown_pubkey(boolean val) {
217-
bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val);
218-
Reference.reachabilityFence(this);
219-
Reference.reachabilityFence(val);
220-
}
221-
222146
/**
223147
* Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
224148
* small to claim on-chain.
@@ -328,13 +252,11 @@ public void set_force_close_avoidance_max_fee_satoshis(long val) {
328252
/**
329253
* Constructs a new ChannelConfig given each field
330254
*/
331-
public static ChannelConfig of(int forwarding_fee_proportional_millionths_arg, int forwarding_fee_base_msat_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg, long max_dust_htlc_exposure_msat_arg, long force_close_avoidance_max_fee_satoshis_arg) {
332-
long ret = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg);
255+
public static ChannelConfig of(int forwarding_fee_proportional_millionths_arg, int forwarding_fee_base_msat_arg, short cltv_expiry_delta_arg, long max_dust_htlc_exposure_msat_arg, long force_close_avoidance_max_fee_satoshis_arg) {
256+
long ret = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg);
333257
Reference.reachabilityFence(forwarding_fee_proportional_millionths_arg);
334258
Reference.reachabilityFence(forwarding_fee_base_msat_arg);
335259
Reference.reachabilityFence(cltv_expiry_delta_arg);
336-
Reference.reachabilityFence(announced_channel_arg);
337-
Reference.reachabilityFence(commit_upfront_shutdown_pubkey_arg);
338260
Reference.reachabilityFence(max_dust_htlc_exposure_msat_arg);
339261
Reference.reachabilityFence(force_close_avoidance_max_fee_satoshis_arg);
340262
if (ret >= 0 && ret <= 4096) { return null; }

src/main/java/org/ldk/structs/ChannelDetails.java

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,11 +665,41 @@ public void set_inbound_htlc_maximum_msat(Option_u64Z val) {
665665
Reference.reachabilityFence(val);
666666
}
667667

668+
/**
669+
* Set of configurable parameters that affect channel operation.
670+
*
671+
* This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
672+
*
673+
* Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
674+
*/
675+
@Nullable
676+
public ChannelConfig get_config() {
677+
long ret = bindings.ChannelDetails_get_config(this.ptr);
678+
Reference.reachabilityFence(this);
679+
if (ret >= 0 && ret <= 4096) { return null; }
680+
org.ldk.structs.ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelConfig(null, ret); }
681+
ret_hu_conv.ptrs_to.add(this);
682+
return ret_hu_conv;
683+
}
684+
685+
/**
686+
* Set of configurable parameters that affect channel operation.
687+
*
688+
* This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
689+
*
690+
* Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
691+
*/
692+
public void set_config(@Nullable ChannelConfig val) {
693+
bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr & ~1);
694+
Reference.reachabilityFence(this);
695+
Reference.reachabilityFence(val);
696+
}
697+
668698
/**
669699
* Constructs a new ChannelDetails given each field
670700
*/
671-
public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, ChannelTypeFeatures channel_type_arg, Option_u64Z short_channel_id_arg, Option_u64Z outbound_scid_alias_arg, Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, boolean is_usable_arg, boolean is_public_arg, Option_u64Z inbound_htlc_minimum_msat_arg, Option_u64Z inbound_htlc_maximum_msat_arg) {
672-
long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, channel_type_arg == null ? 0 : channel_type_arg.ptr & ~1, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr);
701+
public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, ChannelTypeFeatures channel_type_arg, Option_u64Z short_channel_id_arg, Option_u64Z outbound_scid_alias_arg, Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, boolean is_usable_arg, boolean is_public_arg, Option_u64Z inbound_htlc_minimum_msat_arg, Option_u64Z inbound_htlc_maximum_msat_arg, ChannelConfig config_arg) {
702+
long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, channel_type_arg == null ? 0 : channel_type_arg.ptr & ~1, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr & ~1);
673703
Reference.reachabilityFence(channel_id_arg);
674704
Reference.reachabilityFence(counterparty_arg);
675705
Reference.reachabilityFence(funding_txo_arg);
@@ -692,6 +722,7 @@ public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty count
692722
Reference.reachabilityFence(is_public_arg);
693723
Reference.reachabilityFence(inbound_htlc_minimum_msat_arg);
694724
Reference.reachabilityFence(inbound_htlc_maximum_msat_arg);
725+
Reference.reachabilityFence(config_arg);
695726
if (ret >= 0 && ret <= 4096) { return null; }
696727
org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); }
697728
ret_hu_conv.ptrs_to.add(ret_hu_conv);

0 commit comments

Comments
 (0)