Skip to content

Commit 32692e0

Browse files
committed
Update auto-generated bindings
1 parent bd77123 commit 32692e0

File tree

263 files changed

+890
-890
lines changed

Some content is hidden

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

263 files changed

+890
-890
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private IncompatibleShutdownScript(long ptr, bindings.LDKAPIError.IncompatibleSh
110110
*/
111111
public APIError clone() {
112112
long ret = bindings.APIError_clone(this.ptr);
113-
if (ret < 1024) { return null; }
113+
if (ret >= 0 && ret < 1024) { return null; }
114114
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
115115
ret_hu_conv.ptrs_to.add(this);
116116
return ret_hu_conv;
@@ -121,7 +121,7 @@ public APIError clone() {
121121
*/
122122
public static APIError apimisuse_error(java.lang.String err) {
123123
long ret = bindings.APIError_apimisuse_error(err);
124-
if (ret < 1024) { return null; }
124+
if (ret >= 0 && ret < 1024) { return null; }
125125
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
126126
ret_hu_conv.ptrs_to.add(ret_hu_conv);
127127
return ret_hu_conv;
@@ -132,7 +132,7 @@ public static APIError apimisuse_error(java.lang.String err) {
132132
*/
133133
public static APIError fee_rate_too_high(java.lang.String err, int feerate) {
134134
long ret = bindings.APIError_fee_rate_too_high(err, feerate);
135-
if (ret < 1024) { return null; }
135+
if (ret >= 0 && ret < 1024) { return null; }
136136
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
137137
ret_hu_conv.ptrs_to.add(ret_hu_conv);
138138
return ret_hu_conv;
@@ -143,7 +143,7 @@ public static APIError fee_rate_too_high(java.lang.String err, int feerate) {
143143
*/
144144
public static APIError route_error(java.lang.String err) {
145145
long ret = bindings.APIError_route_error(err);
146-
if (ret < 1024) { return null; }
146+
if (ret >= 0 && ret < 1024) { return null; }
147147
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
148148
ret_hu_conv.ptrs_to.add(ret_hu_conv);
149149
return ret_hu_conv;
@@ -154,7 +154,7 @@ public static APIError route_error(java.lang.String err) {
154154
*/
155155
public static APIError channel_unavailable(java.lang.String err) {
156156
long ret = bindings.APIError_channel_unavailable(err);
157-
if (ret < 1024) { return null; }
157+
if (ret >= 0 && ret < 1024) { return null; }
158158
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
159159
ret_hu_conv.ptrs_to.add(ret_hu_conv);
160160
return ret_hu_conv;
@@ -165,7 +165,7 @@ public static APIError channel_unavailable(java.lang.String err) {
165165
*/
166166
public static APIError monitor_update_failed() {
167167
long ret = bindings.APIError_monitor_update_failed();
168-
if (ret < 1024) { return null; }
168+
if (ret >= 0 && ret < 1024) { return null; }
169169
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
170170
ret_hu_conv.ptrs_to.add(ret_hu_conv);
171171
return ret_hu_conv;
@@ -176,7 +176,7 @@ public static APIError monitor_update_failed() {
176176
*/
177177
public static APIError incompatible_shutdown_script(ShutdownScript script) {
178178
long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr & ~1);
179-
if (ret < 1024) { return null; }
179+
if (ret >= 0 && ret < 1024) { return null; }
180180
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
181181
ret_hu_conv.ptrs_to.add(ret_hu_conv);
182182
return ret_hu_conv;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public void set_first_per_commitment_point(byte[] val) {
234234
*/
235235
public AcceptChannel clone() {
236236
long ret = bindings.AcceptChannel_clone(this.ptr);
237-
if (ret < 1024) { return null; }
237+
if (ret >= 0 && ret < 1024) { return null; }
238238
AcceptChannel ret_hu_conv = new AcceptChannel(null, ret);
239239
ret_hu_conv.ptrs_to.add(this);
240240
return ret_hu_conv;
@@ -253,7 +253,7 @@ public byte[] write() {
253253
*/
254254
public static Result_AcceptChannelDecodeErrorZ read(byte[] ser) {
255255
long ret = bindings.AcceptChannel_read(ser);
256-
if (ret < 1024) { return null; }
256+
if (ret >= 0 && ret < 1024) { return null; }
257257
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
258258
return ret_hu_conv;
259259
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static Access new_impl(AccessInterface arg) {
5555
*/
5656
public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) {
5757
long ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id);
58-
if (ret < 1024) { return null; }
58+
if (ret >= 0 && ret < 1024) { return null; }
5959
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
6060
return ret_hu_conv;
6161
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void set_bitcoin_signature(byte[] val) {
8484
*/
8585
public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) {
8686
long ret = bindings.AnnouncementSignatures_new(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg);
87-
if (ret < 1024) { return null; }
87+
if (ret >= 0 && ret < 1024) { return null; }
8888
AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret);
8989
ret_hu_conv.ptrs_to.add(ret_hu_conv);
9090
return ret_hu_conv;
@@ -95,7 +95,7 @@ public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channe
9595
*/
9696
public AnnouncementSignatures clone() {
9797
long ret = bindings.AnnouncementSignatures_clone(this.ptr);
98-
if (ret < 1024) { return null; }
98+
if (ret >= 0 && ret < 1024) { return null; }
9999
AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret);
100100
ret_hu_conv.ptrs_to.add(this);
101101
return ret_hu_conv;
@@ -114,7 +114,7 @@ public byte[] write() {
114114
*/
115115
public static Result_AnnouncementSignaturesDecodeErrorZ read(byte[] ser) {
116116
long ret = bindings.AnnouncementSignatures_read(ser);
117-
if (ret < 1024) { return null; }
117+
if (ret >= 0 && ret < 1024) { return null; }
118118
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
119119
return ret_hu_conv;
120120
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected void finalize() throws Throwable {
7979
*/
8080
public static BackgroundProcessor start(ChannelManagerPersister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, NetGraphMsgHandler net_graph_msg_handler, PeerManager peer_manager, Logger logger) {
8181
long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr & ~1, channel_manager == null ? 0 : channel_manager.ptr & ~1, net_graph_msg_handler == null ? 0 : net_graph_msg_handler.ptr & ~1, peer_manager == null ? 0 : peer_manager.ptr & ~1, logger == null ? 0 : logger.ptr);
82-
if (ret < 1024) { return null; }
82+
if (ret >= 0 && ret < 1024) { return null; }
8383
BackgroundProcessor ret_hu_conv = new BackgroundProcessor(null, ret);
8484
ret_hu_conv.ptrs_to.add(ret_hu_conv);
8585
ret_hu_conv.ptrs_to.add(persister);
@@ -105,7 +105,7 @@ public static BackgroundProcessor start(ChannelManagerPersister persister, Event
105105
*/
106106
public Result_NoneErrorZ join() {
107107
long ret = bindings.BackgroundProcessor_join(this.ptr);
108-
if (ret < 1024) { return null; }
108+
if (ret >= 0 && ret < 1024) { return null; }
109109
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
110110
this.ptrs_to.add(this);
111111
// Due to rust's strict-ownership memory model, in some cases we need to "move"
@@ -132,7 +132,7 @@ public Result_NoneErrorZ join() {
132132
*/
133133
public Result_NoneErrorZ stop() {
134134
long ret = bindings.BackgroundProcessor_stop(this.ptr);
135-
if (ret < 1024) { return null; }
135+
if (ret >= 0 && ret < 1024) { return null; }
136136
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
137137
this.ptrs_to.add(this);
138138
// Due to rust's strict-ownership memory model, in some cases we need to "move"

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private MaybeClaimableHTLCAwaitingTimeout(long ptr, bindings.LDKBalance.MaybeCla
105105
*/
106106
public Balance clone() {
107107
long ret = bindings.Balance_clone(this.ptr);
108-
if (ret < 1024) { return null; }
108+
if (ret >= 0 && ret < 1024) { return null; }
109109
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
110110
ret_hu_conv.ptrs_to.add(this);
111111
return ret_hu_conv;
@@ -116,7 +116,7 @@ public Balance clone() {
116116
*/
117117
public static Balance claimable_on_channel_close(long claimable_amount_satoshis) {
118118
long ret = bindings.Balance_claimable_on_channel_close(claimable_amount_satoshis);
119-
if (ret < 1024) { return null; }
119+
if (ret >= 0 && ret < 1024) { return null; }
120120
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
121121
ret_hu_conv.ptrs_to.add(ret_hu_conv);
122122
return ret_hu_conv;
@@ -127,7 +127,7 @@ public static Balance claimable_on_channel_close(long claimable_amount_satoshis)
127127
*/
128128
public static Balance claimable_awaiting_confirmations(long claimable_amount_satoshis, int confirmation_height) {
129129
long ret = bindings.Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
130-
if (ret < 1024) { return null; }
130+
if (ret >= 0 && ret < 1024) { return null; }
131131
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
132132
ret_hu_conv.ptrs_to.add(ret_hu_conv);
133133
return ret_hu_conv;
@@ -138,7 +138,7 @@ public static Balance claimable_awaiting_confirmations(long claimable_amount_sat
138138
*/
139139
public static Balance contentious_claimable(long claimable_amount_satoshis, int timeout_height) {
140140
long ret = bindings.Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
141-
if (ret < 1024) { return null; }
141+
if (ret >= 0 && ret < 1024) { return null; }
142142
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
143143
ret_hu_conv.ptrs_to.add(ret_hu_conv);
144144
return ret_hu_conv;
@@ -149,7 +149,7 @@ public static Balance contentious_claimable(long claimable_amount_satoshis, int
149149
*/
150150
public static Balance maybe_claimable_htlcawaiting_timeout(long claimable_amount_satoshis, int claimable_height) {
151151
long ret = bindings.Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height);
152-
if (ret < 1024) { return null; }
152+
if (ret >= 0 && ret < 1024) { return null; }
153153
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
154154
ret_hu_conv.ptrs_to.add(ret_hu_conv);
155155
return ret_hu_conv;

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public byte[] release_commitment_secret(long idx) {
299299
*/
300300
public Result_NoneNoneZ validate_holder_commitment(HolderCommitmentTransaction holder_tx) {
301301
long ret = bindings.BaseSign_validate_holder_commitment(this.ptr, holder_tx == null ? 0 : holder_tx.ptr & ~1);
302-
if (ret < 1024) { return null; }
302+
if (ret >= 0 && ret < 1024) { return null; }
303303
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
304304
this.ptrs_to.add(holder_tx);
305305
return ret_hu_conv;
@@ -325,7 +325,7 @@ public byte[] channel_keys_id() {
325325
*/
326326
public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) {
327327
long ret = bindings.BaseSign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
328-
if (ret < 1024) { return null; }
328+
if (ret >= 0 && ret < 1024) { return null; }
329329
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
330330
this.ptrs_to.add(commitment_tx);
331331
return ret_hu_conv;
@@ -339,7 +339,7 @@ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitmen
339339
*/
340340
public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) {
341341
long ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, secret);
342-
if (ret < 1024) { return null; }
342+
if (ret >= 0 && ret < 1024) { return null; }
343343
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
344344
return ret_hu_conv;
345345
}
@@ -359,7 +359,7 @@ public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret
359359
*/
360360
public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) {
361361
long ret = bindings.BaseSign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
362-
if (ret < 1024) { return null; }
362+
if (ret >= 0 && ret < 1024) { return null; }
363363
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
364364
this.ptrs_to.add(commitment_tx);
365365
return ret_hu_conv;
@@ -383,7 +383,7 @@ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_
383383
*/
384384
public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) {
385385
long ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, per_commitment_key);
386-
if (ret < 1024) { return null; }
386+
if (ret >= 0 && ret < 1024) { return null; }
387387
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
388388
return ret_hu_conv;
389389
}
@@ -409,7 +409,7 @@ public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long
409409
*/
410410
public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) {
411411
long ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1);
412-
if (ret < 1024) { return null; }
412+
if (ret >= 0 && ret < 1024) { return null; }
413413
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
414414
this.ptrs_to.add(htlc);
415415
return ret_hu_conv;
@@ -436,7 +436,7 @@ public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long i
436436
*/
437437
public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) {
438438
long ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1);
439-
if (ret < 1024) { return null; }
439+
if (ret >= 0 && ret < 1024) { return null; }
440440
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
441441
this.ptrs_to.add(htlc);
442442
return ret_hu_conv;
@@ -450,7 +450,7 @@ public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx,
450450
*/
451451
public Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx) {
452452
long ret = bindings.BaseSign_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr & ~1);
453-
if (ret < 1024) { return null; }
453+
if (ret >= 0 && ret < 1024) { return null; }
454454
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
455455
this.ptrs_to.add(closing_tx);
456456
return ret_hu_conv;
@@ -466,7 +466,7 @@ public Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction closing
466466
*/
467467
public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
468468
long ret = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
469-
if (ret < 1024) { return null; }
469+
if (ret >= 0 && ret < 1024) { return null; }
470470
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
471471
this.ptrs_to.add(msg);
472472
return ret_hu_conv;
@@ -495,7 +495,7 @@ public void ready_channel(ChannelTransactionParameters channel_parameters) {
495495
*/
496496
public ChannelPublicKeys get_pubkeys() {
497497
long ret = bindings.BaseSign_get_pubkeys(this.ptr);
498-
if (ret < 1024) { return null; }
498+
if (ret >= 0 && ret < 1024) { return null; }
499499
ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
500500
ret_hu_conv.ptrs_to.add(this);
501501
return ret_hu_conv;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected void finalize() throws Throwable {
2424
*/
2525
public BestBlock clone() {
2626
long ret = bindings.BestBlock_clone(this.ptr);
27-
if (ret < 1024) { return null; }
27+
if (ret >= 0 && ret < 1024) { return null; }
2828
BestBlock ret_hu_conv = new BestBlock(null, ret);
2929
ret_hu_conv.ptrs_to.add(this);
3030
return ret_hu_conv;
@@ -36,7 +36,7 @@ public BestBlock clone() {
3636
*/
3737
public static BestBlock from_genesis(org.ldk.enums.Network network) {
3838
long ret = bindings.BestBlock_from_genesis(network);
39-
if (ret < 1024) { return null; }
39+
if (ret >= 0 && ret < 1024) { return null; }
4040
BestBlock ret_hu_conv = new BestBlock(null, ret);
4141
ret_hu_conv.ptrs_to.add(ret_hu_conv);
4242
return ret_hu_conv;
@@ -47,7 +47,7 @@ public static BestBlock from_genesis(org.ldk.enums.Network network) {
4747
*/
4848
public static BestBlock of(byte[] block_hash, int height) {
4949
long ret = bindings.BestBlock_new(block_hash, height);
50-
if (ret < 1024) { return null; }
50+
if (ret >= 0 && ret < 1024) { return null; }
5151
BestBlock ret_hu_conv = new BestBlock(null, ret);
5252
ret_hu_conv.ptrs_to.add(ret_hu_conv);
5353
return ret_hu_conv;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void set_txid(byte[] val) {
6060
*/
6161
public static BuiltCommitmentTransaction of(byte[] transaction_arg, byte[] txid_arg) {
6262
long ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg);
63-
if (ret < 1024) { return null; }
63+
if (ret >= 0 && ret < 1024) { return null; }
6464
BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
6565
ret_hu_conv.ptrs_to.add(ret_hu_conv);
6666
return ret_hu_conv;
@@ -71,7 +71,7 @@ public static BuiltCommitmentTransaction of(byte[] transaction_arg, byte[] txid_
7171
*/
7272
public BuiltCommitmentTransaction clone() {
7373
long ret = bindings.BuiltCommitmentTransaction_clone(this.ptr);
74-
if (ret < 1024) { return null; }
74+
if (ret >= 0 && ret < 1024) { return null; }
7575
BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
7676
ret_hu_conv.ptrs_to.add(this);
7777
return ret_hu_conv;
@@ -90,7 +90,7 @@ public byte[] write() {
9090
*/
9191
public static Result_BuiltCommitmentTransactionDecodeErrorZ read(byte[] ser) {
9292
long ret = bindings.BuiltCommitmentTransaction_read(ser);
93-
if (ret < 1024) { return null; }
93+
if (ret >= 0 && ret < 1024) { return null; }
9494
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
9595
return ret_hu_conv;
9696
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected void finalize() throws Throwable {
3838
*/
3939
public static ChainMonitor of(Option_FilterZ chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
4040
long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
41-
if (ret < 1024) { return null; }
41+
if (ret >= 0 && ret < 1024) { return null; }
4242
ChainMonitor ret_hu_conv = new ChainMonitor(null, ret);
4343
ret_hu_conv.ptrs_to.add(ret_hu_conv);
4444
ret_hu_conv.ptrs_to.add(broadcaster);
@@ -77,7 +77,7 @@ public Balance[] get_claimable_balances(ChannelDetails[] ignored_channels) {
7777
*/
7878
public Listen as_Listen() {
7979
long ret = bindings.ChainMonitor_as_Listen(this.ptr);
80-
if (ret < 1024) { return null; }
80+
if (ret >= 0 && ret < 1024) { return null; }
8181
Listen ret_hu_conv = new Listen(null, ret);
8282
ret_hu_conv.ptrs_to.add(this);
8383
return ret_hu_conv;
@@ -89,7 +89,7 @@ public Listen as_Listen() {
8989
*/
9090
public Confirm as_Confirm() {
9191
long ret = bindings.ChainMonitor_as_Confirm(this.ptr);
92-
if (ret < 1024) { return null; }
92+
if (ret >= 0 && ret < 1024) { return null; }
9393
Confirm ret_hu_conv = new Confirm(null, ret);
9494
ret_hu_conv.ptrs_to.add(this);
9595
return ret_hu_conv;
@@ -101,7 +101,7 @@ public Confirm as_Confirm() {
101101
*/
102102
public Watch as_Watch() {
103103
long ret = bindings.ChainMonitor_as_Watch(this.ptr);
104-
if (ret < 1024) { return null; }
104+
if (ret >= 0 && ret < 1024) { return null; }
105105
Watch ret_hu_conv = new Watch(null, ret);
106106
ret_hu_conv.ptrs_to.add(this);
107107
return ret_hu_conv;
@@ -113,7 +113,7 @@ public Watch as_Watch() {
113113
*/
114114
public EventsProvider as_EventsProvider() {
115115
long ret = bindings.ChainMonitor_as_EventsProvider(this.ptr);
116-
if (ret < 1024) { return null; }
116+
if (ret >= 0 && ret < 1024) { return null; }
117117
EventsProvider ret_hu_conv = new EventsProvider(null, ret);
118118
ret_hu_conv.ptrs_to.add(this);
119119
return ret_hu_conv;

0 commit comments

Comments
 (0)