Skip to content

Commit d9af3c7

Browse files
committed
Update auto-generated bindings
1 parent 1347a5b commit d9af3c7

32 files changed

+901
-359
lines changed

liblightningjni_debug.so

341 KB
Binary file not shown.

liblightningjni_release.so

10.5 KB
Binary file not shown.

src/main/java/org/ldk/enums/LDKAccessError.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/**
44
* An error when accessing the chain via [`Access`].
5-
*
6-
* [`Access`]: trait.Access.html
75
*/
86
public enum LDKAccessError {
97
LDKAccessError_UnknownChain,

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ public final static class SendShortIdsQuery extends LDKMessageSendEvent {
202202
public long msg;
203203
SendShortIdsQuery(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
204204
}
205+
public final static class SendReplyChannelRange extends LDKMessageSendEvent {
206+
public byte[] node_id;
207+
public long msg;
208+
SendReplyChannelRange(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
209+
}
205210
static native void init();
206211
}
207212
static { LDKMessageSendEvent.init(); }
@@ -758,6 +763,7 @@ public interface LDKChannelMessageHandler {
758763
void peer_disconnected(byte[] their_node_id, boolean no_connection_possible);
759764
void peer_connected(byte[] their_node_id, long msg);
760765
void handle_channel_reestablish(byte[] their_node_id, long msg);
766+
void handle_channel_update(byte[] their_node_id, long msg);
761767
void handle_error(byte[] their_node_id, long msg);
762768
}
763769
public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider);
@@ -797,6 +803,8 @@ public interface LDKChannelMessageHandler {
797803
public static native void ChannelMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long msg);
798804
// void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg
799805
public static native void ChannelMessageHandler_handle_channel_reestablish(long this_arg, byte[] their_node_id, long msg);
806+
// void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg
807+
public static native void ChannelMessageHandler_handle_channel_update(long this_arg, byte[] their_node_id, long msg);
800808
// void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg
801809
public static native void ChannelMessageHandler_handle_error(long this_arg, byte[] their_node_id, long msg);
802810
public interface LDKRoutingMessageHandler {
@@ -1688,6 +1696,10 @@ public interface LDKSocketDescriptor {
16881696
public static native int ChannelConfig_get_fee_proportional_millionths(long this_ptr);
16891697
// void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
16901698
public static native void ChannelConfig_set_fee_proportional_millionths(long this_ptr, int val);
1699+
// uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
1700+
public static native short ChannelConfig_get_cltv_expiry_delta(long this_ptr);
1701+
// void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
1702+
public static native void ChannelConfig_set_cltv_expiry_delta(long this_ptr, short val);
16911703
// bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16921704
public static native boolean ChannelConfig_get_announced_channel(long this_ptr);
16931705
// void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
@@ -1696,8 +1708,8 @@ public interface LDKSocketDescriptor {
16961708
public static native boolean ChannelConfig_get_commit_upfront_shutdown_pubkey(long this_ptr);
16971709
// void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
16981710
public static native void ChannelConfig_set_commit_upfront_shutdown_pubkey(long this_ptr, boolean val);
1699-
// MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
1700-
public static native long ChannelConfig_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg);
1711+
// MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
1712+
public static native long ChannelConfig_new(int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg);
17011713
// struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
17021714
public static native long ChannelConfig_clone(long orig);
17031715
// MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
@@ -2940,6 +2952,8 @@ public interface LDKSocketDescriptor {
29402952
public static native long ReplyShortChannelIdsEnd_read(byte[] ser);
29412953
// struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
29422954
public static native byte[] ReplyShortChannelIdsEnd_write(long obj);
2955+
// MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
2956+
public static native int QueryChannelRange_end_blocknum(long this_arg);
29432957
// struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
29442958
public static native long QueryChannelRange_read(byte[] ser);
29452959
// struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
* or used independently to monitor channels remotely. See the [module-level documentation] for
1515
* details.
1616
*
17-
* [`chain::Watch`]: ../trait.Watch.html
18-
* [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
19-
* [module-level documentation]: index.html
17+
* [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18+
* [module-level documentation]: crate::chain::chainmonitor
2019
*/
2120
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
2221
public class ChainMonitor extends CommonBase {
@@ -37,10 +36,6 @@ protected void finalize() throws Throwable {
3736
* calls must not exclude any transactions matching the new outputs nor any in-block
3837
* descendants of such transactions. It is not necessary to re-fetch the block to obtain
3938
* updated `txdata`.
40-
*
41-
* [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
42-
* [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
43-
* [`chain::Filter`]: ../trait.Filter.html
4439
*/
4540
public void block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height) {
4641
bindings.ChainMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height);
@@ -51,8 +46,6 @@ public void block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int
5146
* Dispatches to per-channel monitors, which are responsible for updating their on-chain view
5247
* of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
5348
* details.
54-
*
55-
* [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
5649
*/
5750
public void block_disconnected(byte[] header, int disconnected_height) {
5851
bindings.ChainMonitor_block_disconnected(this.ptr, header, disconnected_height);
@@ -66,8 +59,6 @@ public void block_disconnected(byte[] header, int disconnected_height) {
6659
* pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
6760
* always need to fetch full blocks absent another means for determining which blocks contain
6861
* transactions relevant to the watched channels.
69-
*
70-
* [`chain::Filter`]: ../trait.Filter.html
7162
*/
7263
public static ChainMonitor constructor_new(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
7364
long ret = bindings.ChainMonitor_new(chain_source == null ? 0 : chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);

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

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,57 @@ public void set_fee_proportional_millionths(int val) {
4242
bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val);
4343
}
4444

45+
/**
46+
* The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
47+
* the channel this config applies to.
48+
*
49+
* This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
50+
* HTLC balance when a channel appears on-chain whereas
51+
* [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
52+
* (non-HTLC-encumbered) balance.
53+
*
54+
* Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
55+
* we (or one of our watchtowers) MUST be online to check for broadcast of the current
56+
* commitment transaction at least once per this many blocks (minus some margin to allow us
57+
* enough time to broadcast and confirm a transaction, possibly with time in between to RBF
58+
* the spending transaction).
59+
*
60+
* Default value: 72 (12 hours at an average of 6 blocks/hour).
61+
* Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
62+
* [`MIN_CLTV_EXPIRY_DELTA`] instead.
63+
*
64+
* [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
65+
*/
66+
public short get_cltv_expiry_delta() {
67+
short ret = bindings.ChannelConfig_get_cltv_expiry_delta(this.ptr);
68+
return ret;
69+
}
70+
71+
/**
72+
* The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
73+
* the channel this config applies to.
74+
*
75+
* This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
76+
* HTLC balance when a channel appears on-chain whereas
77+
* [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
78+
* (non-HTLC-encumbered) balance.
79+
*
80+
* Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
81+
* we (or one of our watchtowers) MUST be online to check for broadcast of the current
82+
* commitment transaction at least once per this many blocks (minus some margin to allow us
83+
* enough time to broadcast and confirm a transaction, possibly with time in between to RBF
84+
* the spending transaction).
85+
*
86+
* Default value: 72 (12 hours at an average of 6 blocks/hour).
87+
* Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
88+
* [`MIN_CLTV_EXPIRY_DELTA`] instead.
89+
*
90+
* [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
91+
*/
92+
public void set_cltv_expiry_delta(short val) {
93+
bindings.ChannelConfig_set_cltv_expiry_delta(this.ptr, val);
94+
}
95+
4596
/**
4697
* Set to announce the channel publicly and notify all nodes that they can route via this
4798
* channel.
@@ -115,8 +166,8 @@ public void set_commit_upfront_shutdown_pubkey(boolean val) {
115166
/**
116167
* Constructs a new ChannelConfig given each field
117168
*/
118-
public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
119-
long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
169+
public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
170+
long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
120171
ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
121172
ret_hu_conv.ptrs_to.add(ret_hu_conv);
122173
return ret_hu_conv;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ public static ChannelFeatures constructor_empty() {
3939
}
4040

4141
/**
42-
* Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
43-
*
44-
* [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
42+
* Creates a Features with the bits set which are known by the implementation
4543
*/
4644
public static ChannelFeatures constructor_known() {
4745
long ret = bindings.ChannelFeatures_known();

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,43 @@ public void set_minimum_depth(int val) {
4444
}
4545

4646
/**
47-
* Set to the amount of time we require our counterparty to wait to claim their money.
47+
* Set to the number of blocks we require our counterparty to wait to claim their money (ie
48+
* the number of blocks we have to punish our counterparty if they broadcast a revoked
49+
* transaction).
4850
*
49-
* It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
50-
* be online to check for peer having broadcast a revoked transaction to steal our funds
51-
* at least once every our_to_self_delay blocks.
51+
* This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
52+
* be online to check for revoked transactions on-chain at least once every our_to_self_delay
53+
* blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
54+
* possibly with time in between to RBF the spending transaction).
5255
*
5356
* Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
5457
* case of an honest unilateral channel close, which implicitly decrease the economic value of
5558
* our channel.
5659
*
57-
* Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
58-
* opening so you can tweak config to ask for more security, not less.
60+
* Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
61+
* can tweak config to ask for more security, not less.
5962
*/
6063
public short get_our_to_self_delay() {
6164
short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr);
6265
return ret;
6366
}
6467

6568
/**
66-
* Set to the amount of time we require our counterparty to wait to claim their money.
69+
* Set to the number of blocks we require our counterparty to wait to claim their money (ie
70+
* the number of blocks we have to punish our counterparty if they broadcast a revoked
71+
* transaction).
6772
*
68-
* It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
69-
* be online to check for peer having broadcast a revoked transaction to steal our funds
70-
* at least once every our_to_self_delay blocks.
73+
* This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
74+
* be online to check for revoked transactions on-chain at least once every our_to_self_delay
75+
* blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
76+
* possibly with time in between to RBF the spending transaction).
7177
*
7278
* Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
7379
* case of an honest unilateral channel close, which implicitly decrease the economic value of
7480
* our channel.
7581
*
76-
* Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
77-
* opening so you can tweak config to ask for more security, not less.
82+
* Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
83+
* can tweak config to ask for more security, not less.
7884
*/
7985
public void set_our_to_self_delay(short val) {
8086
bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val);

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ public static interface ChannelMessageHandlerInterface {
102102
* Handle an incoming channel_reestablish message from the given peer.
103103
*/
104104
void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg);
105+
/**
106+
* Handle an incoming channel update from the given peer.
107+
*/
108+
void handle_channel_update(byte[] their_node_id, ChannelUpdate msg);
105109
/**
106110
* Handle an incoming error message from the given peer.
107111
*/
@@ -187,6 +191,10 @@ public static ChannelMessageHandler new_impl(ChannelMessageHandlerInterface arg,
187191
ChannelReestablish msg_hu_conv = new ChannelReestablish(null, msg);
188192
arg.handle_channel_reestablish(their_node_id, msg_hu_conv);
189193
}
194+
@Override public void handle_channel_update(byte[] their_node_id, long msg) {
195+
ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
196+
arg.handle_channel_update(their_node_id, msg_hu_conv);
197+
}
190198
@Override public void handle_error(byte[] their_node_id, long msg) {
191199
ErrorMessage msg_hu_conv = new ErrorMessage(null, msg);
192200
arg.handle_error(their_node_id, msg_hu_conv);
@@ -343,6 +351,14 @@ public void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish
343351
this.ptrs_to.add(msg);
344352
}
345353

354+
/**
355+
* Handle an incoming channel update from the given peer.
356+
*/
357+
public void handle_channel_update(byte[] their_node_id, ChannelUpdate msg) {
358+
bindings.ChannelMessageHandler_handle_channel_update(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
359+
this.ptrs_to.add(msg);
360+
}
361+
346362
/**
347363
* Handle an incoming error message from the given peer.
348364
*/

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ public void load_outputs_to_watch(Filter filter) {
133133
/**
134134
* Get the list of HTLCs who's status has been updated on chain. This should be called by
135135
* ChannelManager via [`chain::Watch::release_pending_monitor_events`].
136-
*
137-
* [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
138136
*/
139137
public MonitorEvent[] get_and_clear_pending_monitor_events() {
140138
long[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr);

0 commit comments

Comments
 (0)