From 2ed9081562d00a8645604b07629e963231d49e0f Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 13 Oct 2020 15:06:44 -0400 Subject: [PATCH] Update to support None --- genbindings.py | 4 +- .../java/org/ldk/structs/AcceptChannel.java | 58 +++++++-------- .../ldk/structs/AnnouncementSignatures.java | 18 ++--- .../java/org/ldk/structs/ChainMonitor.java | 2 +- .../org/ldk/structs/ChannelAnnouncement.java | 24 +++--- .../java/org/ldk/structs/ChannelConfig.java | 14 ++-- .../java/org/ldk/structs/ChannelDetails.java | 34 ++++----- .../ldk/structs/ChannelHandshakeConfig.java | 14 ++-- .../ldk/structs/ChannelHandshakeLimits.java | 42 +++++------ .../java/org/ldk/structs/ChannelInfo.java | 24 +++--- .../java/org/ldk/structs/ChannelKeys.java | 2 +- .../java/org/ldk/structs/ChannelManager.java | 6 +- .../ldk/structs/ChannelManagerReadArgs.java | 24 +++--- .../ldk/structs/ChannelMessageHandler.java | 36 ++++----- .../java/org/ldk/structs/ChannelMonitor.java | 2 +- .../org/ldk/structs/ChannelMonitorUpdate.java | 6 +- .../org/ldk/structs/ChannelPublicKeys.java | 22 +++--- .../org/ldk/structs/ChannelReestablish.java | 14 ++-- .../java/org/ldk/structs/ChannelUpdate.java | 12 +-- .../java/org/ldk/structs/ClosingSigned.java | 14 ++-- .../org/ldk/structs/CommitmentSigned.java | 10 +-- .../org/ldk/structs/CommitmentUpdate.java | 10 +-- .../java/org/ldk/structs/DataLossProtect.java | 10 +-- .../ldk/structs/DirectionalChannelInfo.java | 20 ++--- .../java/org/ldk/structs/ErrorMessage.java | 6 +- src/main/java/org/ldk/structs/Filter.java | 2 +- .../java/org/ldk/structs/FundingCreated.java | 18 ++--- .../java/org/ldk/structs/FundingLocked.java | 10 +-- .../java/org/ldk/structs/FundingSigned.java | 10 +-- .../ldk/structs/GossipTimestampFilter.java | 14 ++-- .../ldk/structs/HTLCOutputInCommitment.java | 18 ++--- src/main/java/org/ldk/structs/HTLCUpdate.java | 2 +- .../structs/HolderCommitmentTransaction.java | 10 +-- .../org/ldk/structs/InMemoryChannelKeys.java | 26 +++---- src/main/java/org/ldk/structs/Init.java | 2 +- .../java/org/ldk/structs/MessageHandler.java | 10 +-- .../org/ldk/structs/NetGraphMsgHandler.java | 4 +- .../org/ldk/structs/NodeAnnouncement.java | 12 +-- .../org/ldk/structs/NodeAnnouncementInfo.java | 20 ++--- src/main/java/org/ldk/structs/NodeInfo.java | 8 +- .../java/org/ldk/structs/OpenChannel.java | 74 +++++++++---------- src/main/java/org/ldk/structs/OutPoint.java | 10 +-- .../java/org/ldk/structs/PeerHandleError.java | 4 +- .../java/org/ldk/structs/PeerManager.java | 4 +- src/main/java/org/ldk/structs/Ping.java | 10 +-- src/main/java/org/ldk/structs/Pong.java | 6 +- .../structs/PreCalculatedTxCreationKeys.java | 2 +- .../org/ldk/structs/QueryChannelRange.java | 14 ++-- .../org/ldk/structs/QueryShortChannelIds.java | 6 +- .../org/ldk/structs/ReplyChannelRange.java | 18 ++--- .../ldk/structs/ReplyShortChannelIdsEnd.java | 10 +-- .../java/org/ldk/structs/RevokeAndACK.java | 14 ++-- src/main/java/org/ldk/structs/Route.java | 2 +- src/main/java/org/ldk/structs/RouteHint.java | 24 +++--- src/main/java/org/ldk/structs/RouteHop.java | 28 +++---- .../java/org/ldk/structs/RoutingFees.java | 10 +-- src/main/java/org/ldk/structs/Shutdown.java | 8 +- .../java/org/ldk/structs/TxCreationKeys.java | 22 +++--- .../structs/UnsignedChannelAnnouncement.java | 30 ++++---- .../ldk/structs/UnsignedChannelUpdate.java | 34 ++++----- .../ldk/structs/UnsignedNodeAnnouncement.java | 22 +++--- .../java/org/ldk/structs/UpdateAddHTLC.java | 22 +++--- .../java/org/ldk/structs/UpdateFailHTLC.java | 10 +-- .../ldk/structs/UpdateFailMalformedHTLC.java | 14 ++-- src/main/java/org/ldk/structs/UpdateFee.java | 10 +-- .../org/ldk/structs/UpdateFulfillHTLC.java | 14 ++-- src/main/java/org/ldk/structs/UserConfig.java | 16 ++-- 67 files changed, 516 insertions(+), 516 deletions(-) diff --git a/genbindings.py b/genbindings.py index 7382cdcc..d2cf50db 100755 --- a/genbindings.py +++ b/genbindings.py @@ -498,9 +498,9 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg if info.arg_name == "this_arg": out_java_struct.write("this.ptr") elif info.passed_as_ptr and info.rust_obj in opaque_structs: - out_java_struct.write(info.arg_name + ".ptr & ~1") + out_java_struct.write(info.arg_name + " == null ? 0 : " + info.arg_name + ".ptr & ~1") elif info.passed_as_ptr and info.rust_obj in trait_structs: - out_java_struct.write(info.arg_name + ".ptr") + out_java_struct.write(info.arg_name + " == null ? 0 : " + info.arg_name + ".ptr") else: out_java_struct.write(info.arg_name) out_java_struct.write(")") diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index e781f87d..e7c4b472 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -11,161 +11,161 @@ public class AcceptChannel extends CommonBase { } public AcceptChannel(AcceptChannel orig) { - super(bindings.AcceptChannel_clone(orig.ptr & ~1)); + super(bindings.AcceptChannel_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_temporary_channel_id(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_temporary_channel_id(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_temporary_channel_id(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_dust_limit_satoshis(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this_ptr.ptr & ~1); + long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_dust_limit_satoshis(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_set_dust_limit_satoshis(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_max_htlc_value_in_flight_msat(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr.ptr & ~1); + long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_htlc_value_in_flight_msat(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_channel_reserve_satoshis(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this_ptr.ptr & ~1); + long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_reserve_satoshis(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_set_channel_reserve_satoshis(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_minimum_msat(AcceptChannel this_ptr) { - long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this_ptr.ptr & ~1); + long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_minimum_msat(AcceptChannel this_ptr, long val) { - bindings.AcceptChannel_set_htlc_minimum_msat(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_minimum_depth(AcceptChannel this_ptr) { - int ret = bindings.AcceptChannel_get_minimum_depth(this_ptr.ptr & ~1); + int ret = bindings.AcceptChannel_get_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_minimum_depth(AcceptChannel this_ptr, int val) { - bindings.AcceptChannel_set_minimum_depth(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_to_self_delay(AcceptChannel this_ptr) { - short ret = bindings.AcceptChannel_get_to_self_delay(this_ptr.ptr & ~1); + short ret = bindings.AcceptChannel_get_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_to_self_delay(AcceptChannel this_ptr, short val) { - bindings.AcceptChannel_set_to_self_delay(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_max_accepted_htlcs(AcceptChannel this_ptr) { - short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this_ptr.ptr & ~1); + short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_accepted_htlcs(AcceptChannel this_ptr, short val) { - bindings.AcceptChannel_set_max_accepted_htlcs(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_funding_pubkey(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this_ptr.ptr & ~1); + byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_funding_pubkey(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_funding_pubkey(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_revocation_basepoint(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_revocation_basepoint(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_revocation_basepoint(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_payment_point(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_payment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.AcceptChannel_get_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_payment_point(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_payment_point(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_delayed_payment_basepoint(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_delayed_payment_basepoint(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_delayed_payment_basepoint(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_htlc_basepoint(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_basepoint(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_htlc_basepoint(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_first_per_commitment_point(AcceptChannel this_ptr) { - byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_first_per_commitment_point(AcceptChannel this_ptr, byte[] val) { - bindings.AcceptChannel_set_first_per_commitment_point(this_ptr.ptr & ~1, val); + bindings.AcceptChannel_set_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/AnnouncementSignatures.java b/src/main/java/org/ldk/structs/AnnouncementSignatures.java index dfc143f9..b4812746 100644 --- a/src/main/java/org/ldk/structs/AnnouncementSignatures.java +++ b/src/main/java/org/ldk/structs/AnnouncementSignatures.java @@ -11,51 +11,51 @@ public class AnnouncementSignatures extends CommonBase { } public AnnouncementSignatures(AnnouncementSignatures orig) { - super(bindings.AnnouncementSignatures_clone(orig.ptr & ~1)); + super(bindings.AnnouncementSignatures_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(AnnouncementSignatures this_ptr) { - byte[] ret = bindings.AnnouncementSignatures_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.AnnouncementSignatures_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(AnnouncementSignatures this_ptr, byte[] val) { - bindings.AnnouncementSignatures_set_channel_id(this_ptr.ptr & ~1, val); + bindings.AnnouncementSignatures_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_short_channel_id(AnnouncementSignatures this_ptr) { - long ret = bindings.AnnouncementSignatures_get_short_channel_id(this_ptr.ptr & ~1); + long ret = bindings.AnnouncementSignatures_get_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_short_channel_id(AnnouncementSignatures this_ptr, long val) { - bindings.AnnouncementSignatures_set_short_channel_id(this_ptr.ptr & ~1, val); + bindings.AnnouncementSignatures_set_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_node_signature(AnnouncementSignatures this_ptr) { - byte[] ret = bindings.AnnouncementSignatures_get_node_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.AnnouncementSignatures_get_node_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_signature(AnnouncementSignatures this_ptr, byte[] val) { - bindings.AnnouncementSignatures_set_node_signature(this_ptr.ptr & ~1, val); + bindings.AnnouncementSignatures_set_node_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_bitcoin_signature(AnnouncementSignatures this_ptr) { - byte[] ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_bitcoin_signature(AnnouncementSignatures this_ptr, byte[] val) { - bindings.AnnouncementSignatures_set_bitcoin_signature(this_ptr.ptr & ~1, val); + bindings.AnnouncementSignatures_set_bitcoin_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChainMonitor.java b/src/main/java/org/ldk/structs/ChainMonitor.java index 24ed59fd..55a934a2 100644 --- a/src/main/java/org/ldk/structs/ChainMonitor.java +++ b/src/main/java/org/ldk/structs/ChainMonitor.java @@ -16,7 +16,7 @@ public class ChainMonitor extends CommonBase { } public ChainMonitor(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest) { - super(bindings.ChainMonitor_new(chain_source.ptr, broadcaster.ptr, logger.ptr, feeest.ptr)); + super(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)); this.ptrs_to.add(chain_source); this.ptrs_to.add(broadcaster); this.ptrs_to.add(logger); diff --git a/src/main/java/org/ldk/structs/ChannelAnnouncement.java b/src/main/java/org/ldk/structs/ChannelAnnouncement.java index 1c680670..69c573d8 100644 --- a/src/main/java/org/ldk/structs/ChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/ChannelAnnouncement.java @@ -11,68 +11,68 @@ public class ChannelAnnouncement extends CommonBase { } public ChannelAnnouncement(ChannelAnnouncement orig) { - super(bindings.ChannelAnnouncement_clone(orig.ptr & ~1)); + super(bindings.ChannelAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_node_signature_1(ChannelAnnouncement this_ptr) { - byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_signature_1(ChannelAnnouncement this_ptr, byte[] val) { - bindings.ChannelAnnouncement_set_node_signature_1(this_ptr.ptr & ~1, val); + bindings.ChannelAnnouncement_set_node_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_node_signature_2(ChannelAnnouncement this_ptr) { - byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_signature_2(ChannelAnnouncement this_ptr, byte[] val) { - bindings.ChannelAnnouncement_set_node_signature_2(this_ptr.ptr & ~1, val); + bindings.ChannelAnnouncement_set_node_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_bitcoin_signature_1(ChannelAnnouncement this_ptr) { - byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_bitcoin_signature_1(ChannelAnnouncement this_ptr, byte[] val) { - bindings.ChannelAnnouncement_set_bitcoin_signature_1(this_ptr.ptr & ~1, val); + bindings.ChannelAnnouncement_set_bitcoin_signature_1(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_bitcoin_signature_2(ChannelAnnouncement this_ptr) { - byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_bitcoin_signature_2(ChannelAnnouncement this_ptr, byte[] val) { - bindings.ChannelAnnouncement_set_bitcoin_signature_2(this_ptr.ptr & ~1, val); + bindings.ChannelAnnouncement_set_bitcoin_signature_2(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public UnsignedChannelAnnouncement get_contents(ChannelAnnouncement this_ptr) { - UnsignedChannelAnnouncement ret = new UnsignedChannelAnnouncement(null, bindings.ChannelAnnouncement_get_contents(this_ptr.ptr & ~1)); + UnsignedChannelAnnouncement ret = new UnsignedChannelAnnouncement(null, bindings.ChannelAnnouncement_get_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_contents(ChannelAnnouncement this_ptr, UnsignedChannelAnnouncement val) { - bindings.ChannelAnnouncement_set_contents(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelAnnouncement_set_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public ChannelAnnouncement(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) { - super(bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg.ptr & ~1)); + super(bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1)); this.ptrs_to.add(contents_arg); } diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index ba24fc37..7676cae3 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -11,40 +11,40 @@ public class ChannelConfig extends CommonBase { } public ChannelConfig(ChannelConfig orig) { - super(bindings.ChannelConfig_clone(orig.ptr & ~1)); + super(bindings.ChannelConfig_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public int get_fee_proportional_millionths(ChannelConfig this_ptr) { - int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this_ptr.ptr & ~1); + int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_fee_proportional_millionths(ChannelConfig this_ptr, int val) { - bindings.ChannelConfig_set_fee_proportional_millionths(this_ptr.ptr & ~1, val); + bindings.ChannelConfig_set_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public boolean get_announced_channel(ChannelConfig this_ptr) { - boolean ret = bindings.ChannelConfig_get_announced_channel(this_ptr.ptr & ~1); + boolean ret = bindings.ChannelConfig_get_announced_channel(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_announced_channel(ChannelConfig this_ptr, boolean val) { - bindings.ChannelConfig_set_announced_channel(this_ptr.ptr & ~1, val); + bindings.ChannelConfig_set_announced_channel(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public boolean get_commit_upfront_shutdown_pubkey(ChannelConfig this_ptr) { - boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr.ptr & ~1); + boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_commit_upfront_shutdown_pubkey(ChannelConfig this_ptr, boolean val) { - bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr.ptr & ~1, val); + bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index 93bb22a7..740cb20c 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -11,96 +11,96 @@ public class ChannelDetails extends CommonBase { } public ChannelDetails(ChannelDetails orig) { - super(bindings.ChannelDetails_clone(orig.ptr & ~1)); + super(bindings.ChannelDetails_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(ChannelDetails this_ptr) { - byte[] ret = bindings.ChannelDetails_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelDetails_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(ChannelDetails this_ptr, byte[] val) { - bindings.ChannelDetails_set_channel_id(this_ptr.ptr & ~1, val); + bindings.ChannelDetails_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_remote_network_id(ChannelDetails this_ptr) { - byte[] ret = bindings.ChannelDetails_get_remote_network_id(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelDetails_get_remote_network_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_remote_network_id(ChannelDetails this_ptr, byte[] val) { - bindings.ChannelDetails_set_remote_network_id(this_ptr.ptr & ~1, val); + bindings.ChannelDetails_set_remote_network_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public InitFeatures get_counterparty_features(ChannelDetails this_ptr) { - InitFeatures ret = new InitFeatures(null, bindings.ChannelDetails_get_counterparty_features(this_ptr.ptr & ~1)); + InitFeatures ret = new InitFeatures(null, bindings.ChannelDetails_get_counterparty_features(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_counterparty_features(ChannelDetails this_ptr, InitFeatures val) { - bindings.ChannelDetails_set_counterparty_features(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelDetails_set_counterparty_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public long get_channel_value_satoshis(ChannelDetails this_ptr) { - long ret = bindings.ChannelDetails_get_channel_value_satoshis(this_ptr.ptr & ~1); + long ret = bindings.ChannelDetails_get_channel_value_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_value_satoshis(ChannelDetails this_ptr, long val) { - bindings.ChannelDetails_set_channel_value_satoshis(this_ptr.ptr & ~1, val); + bindings.ChannelDetails_set_channel_value_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_user_id(ChannelDetails this_ptr) { - long ret = bindings.ChannelDetails_get_user_id(this_ptr.ptr & ~1); + long ret = bindings.ChannelDetails_get_user_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_user_id(ChannelDetails this_ptr, long val) { - bindings.ChannelDetails_set_user_id(this_ptr.ptr & ~1, val); + bindings.ChannelDetails_set_user_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_outbound_capacity_msat(ChannelDetails this_ptr) { - long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this_ptr.ptr & ~1); + long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_outbound_capacity_msat(ChannelDetails this_ptr, long val) { - bindings.ChannelDetails_set_outbound_capacity_msat(this_ptr.ptr & ~1, val); + bindings.ChannelDetails_set_outbound_capacity_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_inbound_capacity_msat(ChannelDetails this_ptr) { - long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this_ptr.ptr & ~1); + long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_inbound_capacity_msat(ChannelDetails this_ptr, long val) { - bindings.ChannelDetails_set_inbound_capacity_msat(this_ptr.ptr & ~1, val); + bindings.ChannelDetails_set_inbound_capacity_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public boolean get_is_live(ChannelDetails this_ptr) { - boolean ret = bindings.ChannelDetails_get_is_live(this_ptr.ptr & ~1); + boolean ret = bindings.ChannelDetails_get_is_live(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_is_live(ChannelDetails this_ptr, boolean val) { - bindings.ChannelDetails_set_is_live(this_ptr.ptr & ~1, val); + bindings.ChannelDetails_set_is_live(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java index a01e2a57..f8cea8fd 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java @@ -11,40 +11,40 @@ public class ChannelHandshakeConfig extends CommonBase { } public ChannelHandshakeConfig(ChannelHandshakeConfig orig) { - super(bindings.ChannelHandshakeConfig_clone(orig.ptr & ~1)); + super(bindings.ChannelHandshakeConfig_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public int get_minimum_depth(ChannelHandshakeConfig this_ptr) { - int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this_ptr.ptr & ~1); + int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_minimum_depth(ChannelHandshakeConfig this_ptr, int val) { - bindings.ChannelHandshakeConfig_set_minimum_depth(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeConfig_set_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_our_to_self_delay(ChannelHandshakeConfig this_ptr) { - short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this_ptr.ptr & ~1); + short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_our_to_self_delay(ChannelHandshakeConfig this_ptr, short val) { - bindings.ChannelHandshakeConfig_set_our_to_self_delay(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeConfig_set_our_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_our_htlc_minimum_msat(ChannelHandshakeConfig this_ptr) { - long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr.ptr & ~1); + long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_our_htlc_minimum_msat(ChannelHandshakeConfig this_ptr, long val) { - bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java index 2d6ed0ea..309e07b1 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeLimits.java @@ -11,117 +11,117 @@ public class ChannelHandshakeLimits extends CommonBase { } public ChannelHandshakeLimits(ChannelHandshakeLimits orig) { - super(bindings.ChannelHandshakeLimits_clone(orig.ptr & ~1)); + super(bindings.ChannelHandshakeLimits_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public long get_min_funding_satoshis(ChannelHandshakeLimits this_ptr) { - long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr.ptr & ~1); + long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_min_funding_satoshis(ChannelHandshakeLimits this_ptr, long val) { - bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_max_htlc_minimum_msat(ChannelHandshakeLimits this_ptr) { - long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr.ptr & ~1); + long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_htlc_minimum_msat(ChannelHandshakeLimits this_ptr, long val) { - bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_min_max_htlc_value_in_flight_msat(ChannelHandshakeLimits this_ptr) { - long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr.ptr & ~1); + long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_min_max_htlc_value_in_flight_msat(ChannelHandshakeLimits this_ptr, long val) { - bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_max_channel_reserve_satoshis(ChannelHandshakeLimits this_ptr) { - long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr.ptr & ~1); + long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_channel_reserve_satoshis(ChannelHandshakeLimits this_ptr, long val) { - bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_min_max_accepted_htlcs(ChannelHandshakeLimits this_ptr) { - short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr.ptr & ~1); + short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_min_max_accepted_htlcs(ChannelHandshakeLimits this_ptr, short val) { - bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_min_dust_limit_satoshis(ChannelHandshakeLimits this_ptr) { - long ret = bindings.ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr.ptr & ~1); + long ret = bindings.ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_min_dust_limit_satoshis(ChannelHandshakeLimits this_ptr, long val) { - bindings.ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_max_dust_limit_satoshis(ChannelHandshakeLimits this_ptr) { - long ret = bindings.ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr.ptr & ~1); + long ret = bindings.ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_dust_limit_satoshis(ChannelHandshakeLimits this_ptr, long val) { - bindings.ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_max_minimum_depth(ChannelHandshakeLimits this_ptr) { - int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this_ptr.ptr & ~1); + int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_minimum_depth(ChannelHandshakeLimits this_ptr, int val) { - bindings.ChannelHandshakeLimits_set_max_minimum_depth(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_max_minimum_depth(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public boolean get_force_announced_channel_preference(ChannelHandshakeLimits this_ptr) { - boolean ret = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr.ptr & ~1); + boolean ret = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_force_announced_channel_preference(ChannelHandshakeLimits this_ptr, boolean val) { - bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_their_to_self_delay(ChannelHandshakeLimits this_ptr) { - short ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this_ptr.ptr & ~1); + short ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_their_to_self_delay(ChannelHandshakeLimits this_ptr, short val) { - bindings.ChannelHandshakeLimits_set_their_to_self_delay(this_ptr.ptr & ~1, val); + bindings.ChannelHandshakeLimits_set_their_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index e92dc7eb..67537203 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -11,71 +11,71 @@ public class ChannelInfo extends CommonBase { } public ChannelFeatures get_features(ChannelInfo this_ptr) { - ChannelFeatures ret = new ChannelFeatures(null, bindings.ChannelInfo_get_features(this_ptr.ptr & ~1)); + ChannelFeatures ret = new ChannelFeatures(null, bindings.ChannelInfo_get_features(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_features(ChannelInfo this_ptr, ChannelFeatures val) { - bindings.ChannelInfo_set_features(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelInfo_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public byte[] get_node_one(ChannelInfo this_ptr) { - byte[] ret = bindings.ChannelInfo_get_node_one(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelInfo_get_node_one(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_one(ChannelInfo this_ptr, byte[] val) { - bindings.ChannelInfo_set_node_one(this_ptr.ptr & ~1, val); + bindings.ChannelInfo_set_node_one(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public DirectionalChannelInfo get_one_to_two(ChannelInfo this_ptr) { - DirectionalChannelInfo ret = new DirectionalChannelInfo(null, bindings.ChannelInfo_get_one_to_two(this_ptr.ptr & ~1)); + DirectionalChannelInfo ret = new DirectionalChannelInfo(null, bindings.ChannelInfo_get_one_to_two(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_one_to_two(ChannelInfo this_ptr, DirectionalChannelInfo val) { - bindings.ChannelInfo_set_one_to_two(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelInfo_set_one_to_two(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public byte[] get_node_two(ChannelInfo this_ptr) { - byte[] ret = bindings.ChannelInfo_get_node_two(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelInfo_get_node_two(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_two(ChannelInfo this_ptr, byte[] val) { - bindings.ChannelInfo_set_node_two(this_ptr.ptr & ~1, val); + bindings.ChannelInfo_set_node_two(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public DirectionalChannelInfo get_two_to_one(ChannelInfo this_ptr) { - DirectionalChannelInfo ret = new DirectionalChannelInfo(null, bindings.ChannelInfo_get_two_to_one(this_ptr.ptr & ~1)); + DirectionalChannelInfo ret = new DirectionalChannelInfo(null, bindings.ChannelInfo_get_two_to_one(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_two_to_one(ChannelInfo this_ptr, DirectionalChannelInfo val) { - bindings.ChannelInfo_set_two_to_one(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelInfo_set_two_to_one(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public ChannelAnnouncement get_announcement_message(ChannelInfo this_ptr) { - ChannelAnnouncement ret = new ChannelAnnouncement(null, bindings.ChannelInfo_get_announcement_message(this_ptr.ptr & ~1)); + ChannelAnnouncement ret = new ChannelAnnouncement(null, bindings.ChannelInfo_get_announcement_message(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_announcement_message(ChannelInfo this_ptr, ChannelAnnouncement val) { - bindings.ChannelInfo_set_announcement_message(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelInfo_set_announcement_message(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } diff --git a/src/main/java/org/ldk/structs/ChannelKeys.java b/src/main/java/org/ldk/structs/ChannelKeys.java index dc0a0cd0..de426fff 100644 --- a/src/main/java/org/ldk/structs/ChannelKeys.java +++ b/src/main/java/org/ldk/structs/ChannelKeys.java @@ -34,7 +34,7 @@ public class ChannelKeys extends CommonBase { // Skipped ChannelKeys_call_sign_closing_transaction // Skipped ChannelKeys_call_sign_channel_announcement public void call_on_accept(ChannelPublicKeys channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay) { - bindings.ChannelKeys_call_on_accept(this.ptr, channel_points.ptr & ~1, counterparty_selected_contest_delay, holder_selected_contest_delay); + bindings.ChannelKeys_call_on_accept(this.ptr, channel_points == null ? 0 : channel_points.ptr & ~1, counterparty_selected_contest_delay, holder_selected_contest_delay); this.ptrs_to.add(channel_points); } diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index 901a288d..dbf4feda 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -11,7 +11,7 @@ public class ChannelManager extends CommonBase { } public ChannelManager(LDKNetwork network, FeeEstimator fee_est, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, KeysInterface keys_manager, UserConfig config, long current_blockchain_height) { - super(bindings.ChannelManager_new(network, fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, logger.ptr, keys_manager.ptr, config.ptr & ~1, current_blockchain_height)); + super(bindings.ChannelManager_new(network, fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, keys_manager == null ? 0 : keys_manager.ptr, config == null ? 0 : config.ptr & ~1, current_blockchain_height)); this.ptrs_to.add(fee_est); this.ptrs_to.add(chain_monitor); this.ptrs_to.add(tx_broadcaster); @@ -34,7 +34,7 @@ public class ChannelManager extends CommonBase { // Skipped ChannelManager_send_payment public void funding_transaction_generated(byte[] temporary_channel_id, OutPoint funding_txo) { - bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_txo.ptr & ~1); + bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_txo == null ? 0 : funding_txo.ptr & ~1); this.ptrs_to.add(funding_txo); } @@ -63,7 +63,7 @@ public class ChannelManager extends CommonBase { } public void channel_monitor_updated(OutPoint funding_txo, long highest_applied_update_id) { - bindings.ChannelManager_channel_monitor_updated(this.ptr, funding_txo.ptr & ~1, highest_applied_update_id); + bindings.ChannelManager_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, highest_applied_update_id); this.ptrs_to.add(funding_txo); } diff --git a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java index a7151a53..de7bf4a6 100644 --- a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java +++ b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java @@ -11,78 +11,78 @@ public class ChannelManagerReadArgs extends CommonBase { } public KeysInterface get_keys_manager(ChannelManagerReadArgs this_ptr) { - KeysInterface ret = new KeysInterface(null, bindings.ChannelManagerReadArgs_get_keys_manager(this_ptr.ptr & ~1)); + KeysInterface ret = new KeysInterface(null, bindings.ChannelManagerReadArgs_get_keys_manager(this_ptr == null ? 0 : this_ptr.ptr & ~1)); ret.ptrs_to.add(this); this.ptrs_to.add(this_ptr); return ret; } public void set_keys_manager(ChannelManagerReadArgs this_ptr, KeysInterface val) { - bindings.ChannelManagerReadArgs_set_keys_manager(this_ptr.ptr & ~1, val.ptr); + bindings.ChannelManagerReadArgs_set_keys_manager(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public FeeEstimator get_fee_estimator(ChannelManagerReadArgs this_ptr) { - FeeEstimator ret = new FeeEstimator(null, bindings.ChannelManagerReadArgs_get_fee_estimator(this_ptr.ptr & ~1)); + FeeEstimator ret = new FeeEstimator(null, bindings.ChannelManagerReadArgs_get_fee_estimator(this_ptr == null ? 0 : this_ptr.ptr & ~1)); ret.ptrs_to.add(this); this.ptrs_to.add(this_ptr); return ret; } public void set_fee_estimator(ChannelManagerReadArgs this_ptr, FeeEstimator val) { - bindings.ChannelManagerReadArgs_set_fee_estimator(this_ptr.ptr & ~1, val.ptr); + bindings.ChannelManagerReadArgs_set_fee_estimator(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public Watch get_chain_monitor(ChannelManagerReadArgs this_ptr) { - Watch ret = new Watch(null, bindings.ChannelManagerReadArgs_get_chain_monitor(this_ptr.ptr & ~1)); + Watch ret = new Watch(null, bindings.ChannelManagerReadArgs_get_chain_monitor(this_ptr == null ? 0 : this_ptr.ptr & ~1)); ret.ptrs_to.add(this); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_monitor(ChannelManagerReadArgs this_ptr, Watch val) { - bindings.ChannelManagerReadArgs_set_chain_monitor(this_ptr.ptr & ~1, val.ptr); + bindings.ChannelManagerReadArgs_set_chain_monitor(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public BroadcasterInterface get_tx_broadcaster(ChannelManagerReadArgs this_ptr) { - BroadcasterInterface ret = new BroadcasterInterface(null, bindings.ChannelManagerReadArgs_get_tx_broadcaster(this_ptr.ptr & ~1)); + BroadcasterInterface ret = new BroadcasterInterface(null, bindings.ChannelManagerReadArgs_get_tx_broadcaster(this_ptr == null ? 0 : this_ptr.ptr & ~1)); ret.ptrs_to.add(this); this.ptrs_to.add(this_ptr); return ret; } public void set_tx_broadcaster(ChannelManagerReadArgs this_ptr, BroadcasterInterface val) { - bindings.ChannelManagerReadArgs_set_tx_broadcaster(this_ptr.ptr & ~1, val.ptr); + bindings.ChannelManagerReadArgs_set_tx_broadcaster(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public Logger get_logger(ChannelManagerReadArgs this_ptr) { - Logger ret = new Logger(null, bindings.ChannelManagerReadArgs_get_logger(this_ptr.ptr & ~1)); + Logger ret = new Logger(null, bindings.ChannelManagerReadArgs_get_logger(this_ptr == null ? 0 : this_ptr.ptr & ~1)); ret.ptrs_to.add(this); this.ptrs_to.add(this_ptr); return ret; } public void set_logger(ChannelManagerReadArgs this_ptr, Logger val) { - bindings.ChannelManagerReadArgs_set_logger(this_ptr.ptr & ~1, val.ptr); + bindings.ChannelManagerReadArgs_set_logger(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public UserConfig get_default_config(ChannelManagerReadArgs this_ptr) { - UserConfig ret = new UserConfig(null, bindings.ChannelManagerReadArgs_get_default_config(this_ptr.ptr & ~1)); + UserConfig ret = new UserConfig(null, bindings.ChannelManagerReadArgs_get_default_config(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_default_config(ChannelManagerReadArgs this_ptr, UserConfig val) { - bindings.ChannelManagerReadArgs_set_default_config(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelManagerReadArgs_set_default_config(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index c1de1fb5..a981ecab 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -16,79 +16,79 @@ public class ChannelMessageHandler extends CommonBase { } public void call_handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) { - bindings.ChannelMessageHandler_call_handle_open_channel(this.ptr, their_node_id, their_features.ptr & ~1, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(their_features); this.ptrs_to.add(msg); } public void call_handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) { - bindings.ChannelMessageHandler_call_handle_accept_channel(this.ptr, their_node_id, their_features.ptr & ~1, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(their_features); this.ptrs_to.add(msg); } public void call_handle_funding_created(byte[] their_node_id, FundingCreated msg) { - bindings.ChannelMessageHandler_call_handle_funding_created(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_funding_signed(byte[] their_node_id, FundingSigned msg) { - bindings.ChannelMessageHandler_call_handle_funding_signed(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_funding_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_funding_locked(byte[] their_node_id, FundingLocked msg) { - bindings.ChannelMessageHandler_call_handle_funding_locked(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_funding_locked(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_shutdown(byte[] their_node_id, Shutdown msg) { - bindings.ChannelMessageHandler_call_handle_shutdown(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_shutdown(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_closing_signed(byte[] their_node_id, ClosingSigned msg) { - bindings.ChannelMessageHandler_call_handle_closing_signed(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_closing_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) { - bindings.ChannelMessageHandler_call_handle_update_add_htlc(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_update_add_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) { - bindings.ChannelMessageHandler_call_handle_update_fulfill_htlc(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_update_fulfill_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) { - bindings.ChannelMessageHandler_call_handle_update_fail_htlc(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_update_fail_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) { - bindings.ChannelMessageHandler_call_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) { - bindings.ChannelMessageHandler_call_handle_commitment_signed(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_commitment_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) { - bindings.ChannelMessageHandler_call_handle_revoke_and_ack(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_revoke_and_ack(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_update_fee(byte[] their_node_id, UpdateFee msg) { - bindings.ChannelMessageHandler_call_handle_update_fee(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_update_fee(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) { - bindings.ChannelMessageHandler_call_handle_announcement_signatures(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_announcement_signatures(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } @@ -97,17 +97,17 @@ public class ChannelMessageHandler extends CommonBase { } public void call_peer_connected(byte[] their_node_id, Init msg) { - bindings.ChannelMessageHandler_call_peer_connected(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_peer_connected(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) { - bindings.ChannelMessageHandler_call_handle_channel_reestablish(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_channel_reestablish(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } public void call_handle_error(byte[] their_node_id, ErrorMessage msg) { - bindings.ChannelMessageHandler_call_handle_error(this.ptr, their_node_id, msg.ptr & ~1); + bindings.ChannelMessageHandler_call_handle_error(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index b30c1847..7bb82499 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -22,7 +22,7 @@ public class ChannelMonitor extends CommonBase { // Skipped ChannelMonitor_get_latest_holder_commitment_txn // Skipped ChannelMonitor_block_connected public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - bindings.ChannelMonitor_block_disconnected(this.ptr, header, height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); + bindings.ChannelMonitor_block_disconnected(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); diff --git a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java index 2f914b56..fdf417d5 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelMonitorUpdate.java @@ -11,18 +11,18 @@ public class ChannelMonitorUpdate extends CommonBase { } public ChannelMonitorUpdate(ChannelMonitorUpdate orig) { - super(bindings.ChannelMonitorUpdate_clone(orig.ptr & ~1)); + super(bindings.ChannelMonitorUpdate_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public long get_update_id(ChannelMonitorUpdate this_ptr) { - long ret = bindings.ChannelMonitorUpdate_get_update_id(this_ptr.ptr & ~1); + long ret = bindings.ChannelMonitorUpdate_get_update_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_update_id(ChannelMonitorUpdate this_ptr, long val) { - bindings.ChannelMonitorUpdate_set_update_id(this_ptr.ptr & ~1, val); + bindings.ChannelMonitorUpdate_set_update_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChannelPublicKeys.java b/src/main/java/org/ldk/structs/ChannelPublicKeys.java index edabb75b..45fbc7d8 100644 --- a/src/main/java/org/ldk/structs/ChannelPublicKeys.java +++ b/src/main/java/org/ldk/structs/ChannelPublicKeys.java @@ -11,62 +11,62 @@ public class ChannelPublicKeys extends CommonBase { } public ChannelPublicKeys(ChannelPublicKeys orig) { - super(bindings.ChannelPublicKeys_clone(orig.ptr & ~1)); + super(bindings.ChannelPublicKeys_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_funding_pubkey(ChannelPublicKeys this_ptr) { - byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_funding_pubkey(ChannelPublicKeys this_ptr, byte[] val) { - bindings.ChannelPublicKeys_set_funding_pubkey(this_ptr.ptr & ~1, val); + bindings.ChannelPublicKeys_set_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_revocation_basepoint(ChannelPublicKeys this_ptr) { - byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_revocation_basepoint(ChannelPublicKeys this_ptr, byte[] val) { - bindings.ChannelPublicKeys_set_revocation_basepoint(this_ptr.ptr & ~1, val); + bindings.ChannelPublicKeys_set_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_payment_point(ChannelPublicKeys this_ptr) { - byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_payment_point(ChannelPublicKeys this_ptr, byte[] val) { - bindings.ChannelPublicKeys_set_payment_point(this_ptr.ptr & ~1, val); + bindings.ChannelPublicKeys_set_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_delayed_payment_basepoint(ChannelPublicKeys this_ptr) { - byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_delayed_payment_basepoint(ChannelPublicKeys this_ptr, byte[] val) { - bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr.ptr & ~1, val); + bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_htlc_basepoint(ChannelPublicKeys this_ptr) { - byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_basepoint(ChannelPublicKeys this_ptr, byte[] val) { - bindings.ChannelPublicKeys_set_htlc_basepoint(this_ptr.ptr & ~1, val); + bindings.ChannelPublicKeys_set_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChannelReestablish.java b/src/main/java/org/ldk/structs/ChannelReestablish.java index ee92dc0f..476c9245 100644 --- a/src/main/java/org/ldk/structs/ChannelReestablish.java +++ b/src/main/java/org/ldk/structs/ChannelReestablish.java @@ -11,40 +11,40 @@ public class ChannelReestablish extends CommonBase { } public ChannelReestablish(ChannelReestablish orig) { - super(bindings.ChannelReestablish_clone(orig.ptr & ~1)); + super(bindings.ChannelReestablish_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(ChannelReestablish this_ptr) { - byte[] ret = bindings.ChannelReestablish_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelReestablish_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(ChannelReestablish this_ptr, byte[] val) { - bindings.ChannelReestablish_set_channel_id(this_ptr.ptr & ~1, val); + bindings.ChannelReestablish_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_next_local_commitment_number(ChannelReestablish this_ptr) { - long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this_ptr.ptr & ~1); + long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_next_local_commitment_number(ChannelReestablish this_ptr, long val) { - bindings.ChannelReestablish_set_next_local_commitment_number(this_ptr.ptr & ~1, val); + bindings.ChannelReestablish_set_next_local_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_next_remote_commitment_number(ChannelReestablish this_ptr) { - long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this_ptr.ptr & ~1); + long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_next_remote_commitment_number(ChannelReestablish this_ptr, long val) { - bindings.ChannelReestablish_set_next_remote_commitment_number(this_ptr.ptr & ~1, val); + bindings.ChannelReestablish_set_next_remote_commitment_number(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ChannelUpdate.java b/src/main/java/org/ldk/structs/ChannelUpdate.java index f71d5cb9..5dc08615 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelUpdate.java @@ -11,35 +11,35 @@ public class ChannelUpdate extends CommonBase { } public ChannelUpdate(ChannelUpdate orig) { - super(bindings.ChannelUpdate_clone(orig.ptr & ~1)); + super(bindings.ChannelUpdate_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_signature(ChannelUpdate this_ptr) { - byte[] ret = bindings.ChannelUpdate_get_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.ChannelUpdate_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_signature(ChannelUpdate this_ptr, byte[] val) { - bindings.ChannelUpdate_set_signature(this_ptr.ptr & ~1, val); + bindings.ChannelUpdate_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public UnsignedChannelUpdate get_contents(ChannelUpdate this_ptr) { - UnsignedChannelUpdate ret = new UnsignedChannelUpdate(null, bindings.ChannelUpdate_get_contents(this_ptr.ptr & ~1)); + UnsignedChannelUpdate ret = new UnsignedChannelUpdate(null, bindings.ChannelUpdate_get_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_contents(ChannelUpdate this_ptr, UnsignedChannelUpdate val) { - bindings.ChannelUpdate_set_contents(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.ChannelUpdate_set_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public ChannelUpdate(byte[] signature_arg, UnsignedChannelUpdate contents_arg) { - super(bindings.ChannelUpdate_new(signature_arg, contents_arg.ptr & ~1)); + super(bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1)); this.ptrs_to.add(contents_arg); } diff --git a/src/main/java/org/ldk/structs/ClosingSigned.java b/src/main/java/org/ldk/structs/ClosingSigned.java index 25edd17c..4d30d0b2 100644 --- a/src/main/java/org/ldk/structs/ClosingSigned.java +++ b/src/main/java/org/ldk/structs/ClosingSigned.java @@ -11,40 +11,40 @@ public class ClosingSigned extends CommonBase { } public ClosingSigned(ClosingSigned orig) { - super(bindings.ClosingSigned_clone(orig.ptr & ~1)); + super(bindings.ClosingSigned_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(ClosingSigned this_ptr) { - byte[] ret = bindings.ClosingSigned_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.ClosingSigned_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(ClosingSigned this_ptr, byte[] val) { - bindings.ClosingSigned_set_channel_id(this_ptr.ptr & ~1, val); + bindings.ClosingSigned_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_fee_satoshis(ClosingSigned this_ptr) { - long ret = bindings.ClosingSigned_get_fee_satoshis(this_ptr.ptr & ~1); + long ret = bindings.ClosingSigned_get_fee_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_fee_satoshis(ClosingSigned this_ptr, long val) { - bindings.ClosingSigned_set_fee_satoshis(this_ptr.ptr & ~1, val); + bindings.ClosingSigned_set_fee_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_signature(ClosingSigned this_ptr) { - byte[] ret = bindings.ClosingSigned_get_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.ClosingSigned_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_signature(ClosingSigned this_ptr, byte[] val) { - bindings.ClosingSigned_set_signature(this_ptr.ptr & ~1, val); + bindings.ClosingSigned_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index cb7870de..1a8b6aa7 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -11,29 +11,29 @@ public class CommitmentSigned extends CommonBase { } public CommitmentSigned(CommitmentSigned orig) { - super(bindings.CommitmentSigned_clone(orig.ptr & ~1)); + super(bindings.CommitmentSigned_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(CommitmentSigned this_ptr) { - byte[] ret = bindings.CommitmentSigned_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.CommitmentSigned_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(CommitmentSigned this_ptr, byte[] val) { - bindings.CommitmentSigned_set_channel_id(this_ptr.ptr & ~1, val); + bindings.CommitmentSigned_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_signature(CommitmentSigned this_ptr) { - byte[] ret = bindings.CommitmentSigned_get_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.CommitmentSigned_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_signature(CommitmentSigned this_ptr, byte[] val) { - bindings.CommitmentSigned_set_signature(this_ptr.ptr & ~1, val); + bindings.CommitmentSigned_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index d886689d..a5de9e9d 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -11,7 +11,7 @@ public class CommitmentUpdate extends CommonBase { } public CommitmentUpdate(CommitmentUpdate orig) { - super(bindings.CommitmentUpdate_clone(orig.ptr & ~1)); + super(bindings.CommitmentUpdate_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } @@ -20,25 +20,25 @@ public class CommitmentUpdate extends CommonBase { // Skipped CommitmentUpdate_set_update_fail_htlcs // Skipped CommitmentUpdate_set_update_fail_malformed_htlcs public UpdateFee get_update_fee(CommitmentUpdate this_ptr) { - UpdateFee ret = new UpdateFee(null, bindings.CommitmentUpdate_get_update_fee(this_ptr.ptr & ~1)); + UpdateFee ret = new UpdateFee(null, bindings.CommitmentUpdate_get_update_fee(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_update_fee(CommitmentUpdate this_ptr, UpdateFee val) { - bindings.CommitmentUpdate_set_update_fee(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.CommitmentUpdate_set_update_fee(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public CommitmentSigned get_commitment_signed(CommitmentUpdate this_ptr) { - CommitmentSigned ret = new CommitmentSigned(null, bindings.CommitmentUpdate_get_commitment_signed(this_ptr.ptr & ~1)); + CommitmentSigned ret = new CommitmentSigned(null, bindings.CommitmentUpdate_get_commitment_signed(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_commitment_signed(CommitmentUpdate this_ptr, CommitmentSigned val) { - bindings.CommitmentUpdate_set_commitment_signed(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.CommitmentUpdate_set_commitment_signed(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } diff --git a/src/main/java/org/ldk/structs/DataLossProtect.java b/src/main/java/org/ldk/structs/DataLossProtect.java index dc59351f..47f90cf9 100644 --- a/src/main/java/org/ldk/structs/DataLossProtect.java +++ b/src/main/java/org/ldk/structs/DataLossProtect.java @@ -11,29 +11,29 @@ public class DataLossProtect extends CommonBase { } public DataLossProtect(DataLossProtect orig) { - super(bindings.DataLossProtect_clone(orig.ptr & ~1)); + super(bindings.DataLossProtect_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_your_last_per_commitment_secret(DataLossProtect this_ptr) { - byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this_ptr.ptr & ~1); + byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_your_last_per_commitment_secret(DataLossProtect this_ptr, byte[] val) { - bindings.DataLossProtect_set_your_last_per_commitment_secret(this_ptr.ptr & ~1, val); + bindings.DataLossProtect_set_your_last_per_commitment_secret(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_my_current_per_commitment_point(DataLossProtect this_ptr) { - byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_my_current_per_commitment_point(DataLossProtect this_ptr, byte[] val) { - bindings.DataLossProtect_set_my_current_per_commitment_point(this_ptr.ptr & ~1, val); + bindings.DataLossProtect_set_my_current_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java index a0f87905..c708cbed 100644 --- a/src/main/java/org/ldk/structs/DirectionalChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectionalChannelInfo.java @@ -11,57 +11,57 @@ public class DirectionalChannelInfo extends CommonBase { } public int get_last_update(DirectionalChannelInfo this_ptr) { - int ret = bindings.DirectionalChannelInfo_get_last_update(this_ptr.ptr & ~1); + int ret = bindings.DirectionalChannelInfo_get_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_last_update(DirectionalChannelInfo this_ptr, int val) { - bindings.DirectionalChannelInfo_set_last_update(this_ptr.ptr & ~1, val); + bindings.DirectionalChannelInfo_set_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public boolean get_enabled(DirectionalChannelInfo this_ptr) { - boolean ret = bindings.DirectionalChannelInfo_get_enabled(this_ptr.ptr & ~1); + boolean ret = bindings.DirectionalChannelInfo_get_enabled(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_enabled(DirectionalChannelInfo this_ptr, boolean val) { - bindings.DirectionalChannelInfo_set_enabled(this_ptr.ptr & ~1, val); + bindings.DirectionalChannelInfo_set_enabled(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_cltv_expiry_delta(DirectionalChannelInfo this_ptr) { - short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr.ptr & ~1); + short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_cltv_expiry_delta(DirectionalChannelInfo this_ptr, short val) { - bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr.ptr & ~1, val); + bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_minimum_msat(DirectionalChannelInfo this_ptr) { - long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr.ptr & ~1); + long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_minimum_msat(DirectionalChannelInfo this_ptr, long val) { - bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr.ptr & ~1, val); + bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public ChannelUpdate get_last_update_message(DirectionalChannelInfo this_ptr) { - ChannelUpdate ret = new ChannelUpdate(null, bindings.DirectionalChannelInfo_get_last_update_message(this_ptr.ptr & ~1)); + ChannelUpdate ret = new ChannelUpdate(null, bindings.DirectionalChannelInfo_get_last_update_message(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_last_update_message(DirectionalChannelInfo this_ptr, ChannelUpdate val) { - bindings.DirectionalChannelInfo_set_last_update_message(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.DirectionalChannelInfo_set_last_update_message(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } diff --git a/src/main/java/org/ldk/structs/ErrorMessage.java b/src/main/java/org/ldk/structs/ErrorMessage.java index 1ca776f5..b63931d6 100644 --- a/src/main/java/org/ldk/structs/ErrorMessage.java +++ b/src/main/java/org/ldk/structs/ErrorMessage.java @@ -11,18 +11,18 @@ public class ErrorMessage extends CommonBase { } public ErrorMessage(ErrorMessage orig) { - super(bindings.ErrorMessage_clone(orig.ptr & ~1)); + super(bindings.ErrorMessage_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(ErrorMessage this_ptr) { - byte[] ret = bindings.ErrorMessage_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.ErrorMessage_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(ErrorMessage this_ptr, byte[] val) { - bindings.ErrorMessage_set_channel_id(this_ptr.ptr & ~1, val); + bindings.ErrorMessage_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/Filter.java b/src/main/java/org/ldk/structs/Filter.java index da80074d..ffc2cbaa 100644 --- a/src/main/java/org/ldk/structs/Filter.java +++ b/src/main/java/org/ldk/structs/Filter.java @@ -20,7 +20,7 @@ public class Filter extends CommonBase { } public void call_register_output(OutPoint outpoint, byte[] script_pubkey) { - bindings.Filter_call_register_output(this.ptr, outpoint.ptr & ~1, script_pubkey); + bindings.Filter_call_register_output(this.ptr, outpoint == null ? 0 : outpoint.ptr & ~1, script_pubkey); this.ptrs_to.add(outpoint); } diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index 66f48511..e199467c 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -11,51 +11,51 @@ public class FundingCreated extends CommonBase { } public FundingCreated(FundingCreated orig) { - super(bindings.FundingCreated_clone(orig.ptr & ~1)); + super(bindings.FundingCreated_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_temporary_channel_id(FundingCreated this_ptr) { - byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_temporary_channel_id(FundingCreated this_ptr, byte[] val) { - bindings.FundingCreated_set_temporary_channel_id(this_ptr.ptr & ~1, val); + bindings.FundingCreated_set_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_funding_txid(FundingCreated this_ptr) { - byte[] ret = bindings.FundingCreated_get_funding_txid(this_ptr.ptr & ~1); + byte[] ret = bindings.FundingCreated_get_funding_txid(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_funding_txid(FundingCreated this_ptr, byte[] val) { - bindings.FundingCreated_set_funding_txid(this_ptr.ptr & ~1, val); + bindings.FundingCreated_set_funding_txid(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_funding_output_index(FundingCreated this_ptr) { - short ret = bindings.FundingCreated_get_funding_output_index(this_ptr.ptr & ~1); + short ret = bindings.FundingCreated_get_funding_output_index(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_funding_output_index(FundingCreated this_ptr, short val) { - bindings.FundingCreated_set_funding_output_index(this_ptr.ptr & ~1, val); + bindings.FundingCreated_set_funding_output_index(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_signature(FundingCreated this_ptr) { - byte[] ret = bindings.FundingCreated_get_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.FundingCreated_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_signature(FundingCreated this_ptr, byte[] val) { - bindings.FundingCreated_set_signature(this_ptr.ptr & ~1, val); + bindings.FundingCreated_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/FundingLocked.java b/src/main/java/org/ldk/structs/FundingLocked.java index b330b650..1cd857e7 100644 --- a/src/main/java/org/ldk/structs/FundingLocked.java +++ b/src/main/java/org/ldk/structs/FundingLocked.java @@ -11,29 +11,29 @@ public class FundingLocked extends CommonBase { } public FundingLocked(FundingLocked orig) { - super(bindings.FundingLocked_clone(orig.ptr & ~1)); + super(bindings.FundingLocked_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(FundingLocked this_ptr) { - byte[] ret = bindings.FundingLocked_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.FundingLocked_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(FundingLocked this_ptr, byte[] val) { - bindings.FundingLocked_set_channel_id(this_ptr.ptr & ~1, val); + bindings.FundingLocked_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_next_per_commitment_point(FundingLocked this_ptr) { - byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_next_per_commitment_point(FundingLocked this_ptr, byte[] val) { - bindings.FundingLocked_set_next_per_commitment_point(this_ptr.ptr & ~1, val); + bindings.FundingLocked_set_next_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/FundingSigned.java b/src/main/java/org/ldk/structs/FundingSigned.java index fa19de19..52819434 100644 --- a/src/main/java/org/ldk/structs/FundingSigned.java +++ b/src/main/java/org/ldk/structs/FundingSigned.java @@ -11,29 +11,29 @@ public class FundingSigned extends CommonBase { } public FundingSigned(FundingSigned orig) { - super(bindings.FundingSigned_clone(orig.ptr & ~1)); + super(bindings.FundingSigned_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(FundingSigned this_ptr) { - byte[] ret = bindings.FundingSigned_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.FundingSigned_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(FundingSigned this_ptr, byte[] val) { - bindings.FundingSigned_set_channel_id(this_ptr.ptr & ~1, val); + bindings.FundingSigned_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_signature(FundingSigned this_ptr) { - byte[] ret = bindings.FundingSigned_get_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.FundingSigned_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_signature(FundingSigned this_ptr, byte[] val) { - bindings.FundingSigned_set_signature(this_ptr.ptr & ~1, val); + bindings.FundingSigned_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index a7b184c5..5d5cc30b 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -11,40 +11,40 @@ public class GossipTimestampFilter extends CommonBase { } public GossipTimestampFilter(GossipTimestampFilter orig) { - super(bindings.GossipTimestampFilter_clone(orig.ptr & ~1)); + super(bindings.GossipTimestampFilter_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_chain_hash(GossipTimestampFilter this_ptr) { - byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(GossipTimestampFilter this_ptr, byte[] val) { - bindings.GossipTimestampFilter_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.GossipTimestampFilter_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_first_timestamp(GossipTimestampFilter this_ptr) { - int ret = bindings.GossipTimestampFilter_get_first_timestamp(this_ptr.ptr & ~1); + int ret = bindings.GossipTimestampFilter_get_first_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_first_timestamp(GossipTimestampFilter this_ptr, int val) { - bindings.GossipTimestampFilter_set_first_timestamp(this_ptr.ptr & ~1, val); + bindings.GossipTimestampFilter_set_first_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_timestamp_range(GossipTimestampFilter this_ptr) { - int ret = bindings.GossipTimestampFilter_get_timestamp_range(this_ptr.ptr & ~1); + int ret = bindings.GossipTimestampFilter_get_timestamp_range(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_timestamp_range(GossipTimestampFilter this_ptr, int val) { - bindings.GossipTimestampFilter_set_timestamp_range(this_ptr.ptr & ~1, val); + bindings.GossipTimestampFilter_set_timestamp_range(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java index f1286044..d25beabe 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -11,51 +11,51 @@ public class HTLCOutputInCommitment extends CommonBase { } public HTLCOutputInCommitment(HTLCOutputInCommitment orig) { - super(bindings.HTLCOutputInCommitment_clone(orig.ptr & ~1)); + super(bindings.HTLCOutputInCommitment_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public boolean get_offered(HTLCOutputInCommitment this_ptr) { - boolean ret = bindings.HTLCOutputInCommitment_get_offered(this_ptr.ptr & ~1); + boolean ret = bindings.HTLCOutputInCommitment_get_offered(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_offered(HTLCOutputInCommitment this_ptr, boolean val) { - bindings.HTLCOutputInCommitment_set_offered(this_ptr.ptr & ~1, val); + bindings.HTLCOutputInCommitment_set_offered(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_amount_msat(HTLCOutputInCommitment this_ptr) { - long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this_ptr.ptr & ~1); + long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_amount_msat(HTLCOutputInCommitment this_ptr, long val) { - bindings.HTLCOutputInCommitment_set_amount_msat(this_ptr.ptr & ~1, val); + bindings.HTLCOutputInCommitment_set_amount_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_cltv_expiry(HTLCOutputInCommitment this_ptr) { - int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this_ptr.ptr & ~1); + int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_cltv_expiry(HTLCOutputInCommitment this_ptr, int val) { - bindings.HTLCOutputInCommitment_set_cltv_expiry(this_ptr.ptr & ~1, val); + bindings.HTLCOutputInCommitment_set_cltv_expiry(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_payment_hash(HTLCOutputInCommitment this_ptr) { - byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_payment_hash(HTLCOutputInCommitment this_ptr, byte[] val) { - bindings.HTLCOutputInCommitment_set_payment_hash(this_ptr.ptr & ~1, val); + bindings.HTLCOutputInCommitment_set_payment_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index f1bb07be..01e06eb7 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -11,7 +11,7 @@ public class HTLCUpdate extends CommonBase { } public HTLCUpdate(HTLCUpdate orig) { - super(bindings.HTLCUpdate_clone(orig.ptr & ~1)); + super(bindings.HTLCUpdate_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } diff --git a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java index 92e15aa4..aa729ac7 100644 --- a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java @@ -11,31 +11,31 @@ public class HolderCommitmentTransaction extends CommonBase { } public HolderCommitmentTransaction(HolderCommitmentTransaction orig) { - super(bindings.HolderCommitmentTransaction_clone(orig.ptr & ~1)); + super(bindings.HolderCommitmentTransaction_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } // Skipped HolderCommitmentTransaction_get_unsigned_tx // Skipped HolderCommitmentTransaction_set_unsigned_tx public byte[] get_counterparty_sig(HolderCommitmentTransaction this_ptr) { - byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this_ptr.ptr & ~1); + byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_counterparty_sig(HolderCommitmentTransaction this_ptr, byte[] val) { - bindings.HolderCommitmentTransaction_set_counterparty_sig(this_ptr.ptr & ~1, val); + bindings.HolderCommitmentTransaction_set_counterparty_sig(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_feerate_per_kw(HolderCommitmentTransaction this_ptr) { - int ret = bindings.HolderCommitmentTransaction_get_feerate_per_kw(this_ptr.ptr & ~1); + int ret = bindings.HolderCommitmentTransaction_get_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_feerate_per_kw(HolderCommitmentTransaction this_ptr, int val) { - bindings.HolderCommitmentTransaction_set_feerate_per_kw(this_ptr.ptr & ~1, val); + bindings.HolderCommitmentTransaction_set_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/InMemoryChannelKeys.java b/src/main/java/org/ldk/structs/InMemoryChannelKeys.java index 2d4b54f7..1740e663 100644 --- a/src/main/java/org/ldk/structs/InMemoryChannelKeys.java +++ b/src/main/java/org/ldk/structs/InMemoryChannelKeys.java @@ -11,73 +11,73 @@ public class InMemoryChannelKeys extends CommonBase { } public InMemoryChannelKeys(InMemoryChannelKeys orig) { - super(bindings.InMemoryChannelKeys_clone(orig.ptr & ~1)); + super(bindings.InMemoryChannelKeys_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_funding_key(InMemoryChannelKeys this_ptr) { - byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this_ptr.ptr & ~1); + byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_funding_key(InMemoryChannelKeys this_ptr, byte[] val) { - bindings.InMemoryChannelKeys_set_funding_key(this_ptr.ptr & ~1, val); + bindings.InMemoryChannelKeys_set_funding_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_revocation_base_key(InMemoryChannelKeys this_ptr) { - byte[] ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this_ptr.ptr & ~1); + byte[] ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_revocation_base_key(InMemoryChannelKeys this_ptr, byte[] val) { - bindings.InMemoryChannelKeys_set_revocation_base_key(this_ptr.ptr & ~1, val); + bindings.InMemoryChannelKeys_set_revocation_base_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_payment_key(InMemoryChannelKeys this_ptr) { - byte[] ret = bindings.InMemoryChannelKeys_get_payment_key(this_ptr.ptr & ~1); + byte[] ret = bindings.InMemoryChannelKeys_get_payment_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_payment_key(InMemoryChannelKeys this_ptr, byte[] val) { - bindings.InMemoryChannelKeys_set_payment_key(this_ptr.ptr & ~1, val); + bindings.InMemoryChannelKeys_set_payment_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_delayed_payment_base_key(InMemoryChannelKeys this_ptr) { - byte[] ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr.ptr & ~1); + byte[] ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_delayed_payment_base_key(InMemoryChannelKeys this_ptr, byte[] val) { - bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr.ptr & ~1, val); + bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_htlc_base_key(InMemoryChannelKeys this_ptr) { - byte[] ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this_ptr.ptr & ~1); + byte[] ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_base_key(InMemoryChannelKeys this_ptr, byte[] val) { - bindings.InMemoryChannelKeys_set_htlc_base_key(this_ptr.ptr & ~1, val); + bindings.InMemoryChannelKeys_set_htlc_base_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_commitment_seed(InMemoryChannelKeys this_ptr) { - byte[] ret = bindings.InMemoryChannelKeys_get_commitment_seed(this_ptr.ptr & ~1); + byte[] ret = bindings.InMemoryChannelKeys_get_commitment_seed(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_commitment_seed(InMemoryChannelKeys this_ptr, byte[] val) { - bindings.InMemoryChannelKeys_set_commitment_seed(this_ptr.ptr & ~1, val); + bindings.InMemoryChannelKeys_set_commitment_seed(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index 3061c7e4..576e95c3 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -11,7 +11,7 @@ public class Init extends CommonBase { } public Init(Init orig) { - super(bindings.Init_clone(orig.ptr & ~1)); + super(bindings.Init_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } diff --git a/src/main/java/org/ldk/structs/MessageHandler.java b/src/main/java/org/ldk/structs/MessageHandler.java index 32fc51a3..b6246cd4 100644 --- a/src/main/java/org/ldk/structs/MessageHandler.java +++ b/src/main/java/org/ldk/structs/MessageHandler.java @@ -11,33 +11,33 @@ public class MessageHandler extends CommonBase { } public ChannelMessageHandler get_chan_handler(MessageHandler this_ptr) { - ChannelMessageHandler ret = new ChannelMessageHandler(null, bindings.MessageHandler_get_chan_handler(this_ptr.ptr & ~1)); + ChannelMessageHandler ret = new ChannelMessageHandler(null, bindings.MessageHandler_get_chan_handler(this_ptr == null ? 0 : this_ptr.ptr & ~1)); ret.ptrs_to.add(this); this.ptrs_to.add(this_ptr); return ret; } public void set_chan_handler(MessageHandler this_ptr, ChannelMessageHandler val) { - bindings.MessageHandler_set_chan_handler(this_ptr.ptr & ~1, val.ptr); + bindings.MessageHandler_set_chan_handler(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public RoutingMessageHandler get_route_handler(MessageHandler this_ptr) { - RoutingMessageHandler ret = new RoutingMessageHandler(null, bindings.MessageHandler_get_route_handler(this_ptr.ptr & ~1)); + RoutingMessageHandler ret = new RoutingMessageHandler(null, bindings.MessageHandler_get_route_handler(this_ptr == null ? 0 : this_ptr.ptr & ~1)); ret.ptrs_to.add(this); this.ptrs_to.add(this_ptr); return ret; } public void set_route_handler(MessageHandler this_ptr, RoutingMessageHandler val) { - bindings.MessageHandler_set_route_handler(this_ptr.ptr & ~1, val.ptr); + bindings.MessageHandler_set_route_handler(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public MessageHandler(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg) { - super(bindings.MessageHandler_new(chan_handler_arg.ptr, route_handler_arg.ptr)); + super(bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr)); this.ptrs_to.add(chan_handler_arg); this.ptrs_to.add(route_handler_arg); } diff --git a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java index c873c852..02dfafc3 100644 --- a/src/main/java/org/ldk/structs/NetGraphMsgHandler.java +++ b/src/main/java/org/ldk/structs/NetGraphMsgHandler.java @@ -11,13 +11,13 @@ public class NetGraphMsgHandler extends CommonBase { } public NetGraphMsgHandler(Access chain_access, Logger logger) { - super(bindings.NetGraphMsgHandler_new(chain_access.ptr, logger.ptr)); + super(bindings.NetGraphMsgHandler_new(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr)); this.ptrs_to.add(chain_access); this.ptrs_to.add(logger); } public NetGraphMsgHandler(Access chain_access, Logger logger, NetworkGraph network_graph) { - super(bindings.NetGraphMsgHandler_from_net_graph(chain_access.ptr, logger.ptr, network_graph.ptr & ~1)); + super(bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, network_graph == null ? 0 : network_graph.ptr & ~1)); this.ptrs_to.add(chain_access); this.ptrs_to.add(logger); this.ptrs_to.add(network_graph); diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index 3b562117..b114815f 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -11,35 +11,35 @@ public class NodeAnnouncement extends CommonBase { } public NodeAnnouncement(NodeAnnouncement orig) { - super(bindings.NodeAnnouncement_clone(orig.ptr & ~1)); + super(bindings.NodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_signature(NodeAnnouncement this_ptr) { - byte[] ret = bindings.NodeAnnouncement_get_signature(this_ptr.ptr & ~1); + byte[] ret = bindings.NodeAnnouncement_get_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_signature(NodeAnnouncement this_ptr, byte[] val) { - bindings.NodeAnnouncement_set_signature(this_ptr.ptr & ~1, val); + bindings.NodeAnnouncement_set_signature(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public UnsignedNodeAnnouncement get_contents(NodeAnnouncement this_ptr) { - UnsignedNodeAnnouncement ret = new UnsignedNodeAnnouncement(null, bindings.NodeAnnouncement_get_contents(this_ptr.ptr & ~1)); + UnsignedNodeAnnouncement ret = new UnsignedNodeAnnouncement(null, bindings.NodeAnnouncement_get_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_contents(NodeAnnouncement this_ptr, UnsignedNodeAnnouncement val) { - bindings.NodeAnnouncement_set_contents(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.NodeAnnouncement_set_contents(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public NodeAnnouncement(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) { - super(bindings.NodeAnnouncement_new(signature_arg, contents_arg.ptr & ~1)); + super(bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1)); this.ptrs_to.add(contents_arg); } diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index ea257e8b..2f55d673 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -11,59 +11,59 @@ public class NodeAnnouncementInfo extends CommonBase { } public NodeFeatures get_features(NodeAnnouncementInfo this_ptr) { - NodeFeatures ret = new NodeFeatures(null, bindings.NodeAnnouncementInfo_get_features(this_ptr.ptr & ~1)); + NodeFeatures ret = new NodeFeatures(null, bindings.NodeAnnouncementInfo_get_features(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_features(NodeAnnouncementInfo this_ptr, NodeFeatures val) { - bindings.NodeAnnouncementInfo_set_features(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.NodeAnnouncementInfo_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public int get_last_update(NodeAnnouncementInfo this_ptr) { - int ret = bindings.NodeAnnouncementInfo_get_last_update(this_ptr.ptr & ~1); + int ret = bindings.NodeAnnouncementInfo_get_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_last_update(NodeAnnouncementInfo this_ptr, int val) { - bindings.NodeAnnouncementInfo_set_last_update(this_ptr.ptr & ~1, val); + bindings.NodeAnnouncementInfo_set_last_update(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_rgb(NodeAnnouncementInfo this_ptr) { - byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this_ptr.ptr & ~1); + byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_rgb(NodeAnnouncementInfo this_ptr, byte[] val) { - bindings.NodeAnnouncementInfo_set_rgb(this_ptr.ptr & ~1, val); + bindings.NodeAnnouncementInfo_set_rgb(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_alias(NodeAnnouncementInfo this_ptr) { - byte[] ret = bindings.NodeAnnouncementInfo_get_alias(this_ptr.ptr & ~1); + byte[] ret = bindings.NodeAnnouncementInfo_get_alias(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_alias(NodeAnnouncementInfo this_ptr, byte[] val) { - bindings.NodeAnnouncementInfo_set_alias(this_ptr.ptr & ~1, val); + bindings.NodeAnnouncementInfo_set_alias(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } // Skipped NodeAnnouncementInfo_set_addresses public NodeAnnouncement get_announcement_message(NodeAnnouncementInfo this_ptr) { - NodeAnnouncement ret = new NodeAnnouncement(null, bindings.NodeAnnouncementInfo_get_announcement_message(this_ptr.ptr & ~1)); + NodeAnnouncement ret = new NodeAnnouncement(null, bindings.NodeAnnouncementInfo_get_announcement_message(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_announcement_message(NodeAnnouncementInfo this_ptr, NodeAnnouncement val) { - bindings.NodeAnnouncementInfo_set_announcement_message(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.NodeAnnouncementInfo_set_announcement_message(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index 68af209d..e76ff9e7 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -12,25 +12,25 @@ public class NodeInfo extends CommonBase { // Skipped NodeInfo_set_channels public RoutingFees get_lowest_inbound_channel_fees(NodeInfo this_ptr) { - RoutingFees ret = new RoutingFees(null, bindings.NodeInfo_get_lowest_inbound_channel_fees(this_ptr.ptr & ~1)); + RoutingFees ret = new RoutingFees(null, bindings.NodeInfo_get_lowest_inbound_channel_fees(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_lowest_inbound_channel_fees(NodeInfo this_ptr, RoutingFees val) { - bindings.NodeInfo_set_lowest_inbound_channel_fees(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.NodeInfo_set_lowest_inbound_channel_fees(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public NodeAnnouncementInfo get_announcement_info(NodeInfo this_ptr) { - NodeAnnouncementInfo ret = new NodeAnnouncementInfo(null, bindings.NodeInfo_get_announcement_info(this_ptr.ptr & ~1)); + NodeAnnouncementInfo ret = new NodeAnnouncementInfo(null, bindings.NodeInfo_get_announcement_info(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_announcement_info(NodeInfo this_ptr, NodeAnnouncementInfo val) { - bindings.NodeInfo_set_announcement_info(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.NodeInfo_set_announcement_info(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } diff --git a/src/main/java/org/ldk/structs/OpenChannel.java b/src/main/java/org/ldk/structs/OpenChannel.java index 88cbd24d..87e7d179 100644 --- a/src/main/java/org/ldk/structs/OpenChannel.java +++ b/src/main/java/org/ldk/structs/OpenChannel.java @@ -11,205 +11,205 @@ public class OpenChannel extends CommonBase { } public OpenChannel(OpenChannel orig) { - super(bindings.OpenChannel_clone(orig.ptr & ~1)); + super(bindings.OpenChannel_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_chain_hash(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_temporary_channel_id(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_temporary_channel_id(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_temporary_channel_id(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_temporary_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_funding_satoshis(OpenChannel this_ptr) { - long ret = bindings.OpenChannel_get_funding_satoshis(this_ptr.ptr & ~1); + long ret = bindings.OpenChannel_get_funding_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_funding_satoshis(OpenChannel this_ptr, long val) { - bindings.OpenChannel_set_funding_satoshis(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_funding_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_push_msat(OpenChannel this_ptr) { - long ret = bindings.OpenChannel_get_push_msat(this_ptr.ptr & ~1); + long ret = bindings.OpenChannel_get_push_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_push_msat(OpenChannel this_ptr, long val) { - bindings.OpenChannel_set_push_msat(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_push_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_dust_limit_satoshis(OpenChannel this_ptr) { - long ret = bindings.OpenChannel_get_dust_limit_satoshis(this_ptr.ptr & ~1); + long ret = bindings.OpenChannel_get_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_dust_limit_satoshis(OpenChannel this_ptr, long val) { - bindings.OpenChannel_set_dust_limit_satoshis(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_dust_limit_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_max_htlc_value_in_flight_msat(OpenChannel this_ptr) { - long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr.ptr & ~1); + long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_htlc_value_in_flight_msat(OpenChannel this_ptr, long val) { - bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_channel_reserve_satoshis(OpenChannel this_ptr) { - long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this_ptr.ptr & ~1); + long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_reserve_satoshis(OpenChannel this_ptr, long val) { - bindings.OpenChannel_set_channel_reserve_satoshis(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_channel_reserve_satoshis(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_minimum_msat(OpenChannel this_ptr) { - long ret = bindings.OpenChannel_get_htlc_minimum_msat(this_ptr.ptr & ~1); + long ret = bindings.OpenChannel_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_minimum_msat(OpenChannel this_ptr, long val) { - bindings.OpenChannel_set_htlc_minimum_msat(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_feerate_per_kw(OpenChannel this_ptr) { - int ret = bindings.OpenChannel_get_feerate_per_kw(this_ptr.ptr & ~1); + int ret = bindings.OpenChannel_get_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_feerate_per_kw(OpenChannel this_ptr, int val) { - bindings.OpenChannel_set_feerate_per_kw(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_to_self_delay(OpenChannel this_ptr) { - short ret = bindings.OpenChannel_get_to_self_delay(this_ptr.ptr & ~1); + short ret = bindings.OpenChannel_get_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_to_self_delay(OpenChannel this_ptr, short val) { - bindings.OpenChannel_set_to_self_delay(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_to_self_delay(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_max_accepted_htlcs(OpenChannel this_ptr) { - short ret = bindings.OpenChannel_get_max_accepted_htlcs(this_ptr.ptr & ~1); + short ret = bindings.OpenChannel_get_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_max_accepted_htlcs(OpenChannel this_ptr, short val) { - bindings.OpenChannel_set_max_accepted_htlcs(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_max_accepted_htlcs(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_funding_pubkey(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_funding_pubkey(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_funding_pubkey(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_funding_pubkey(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_funding_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_revocation_basepoint(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_revocation_basepoint(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_revocation_basepoint(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_revocation_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_payment_point(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_payment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_payment_point(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_payment_point(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_payment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_delayed_payment_basepoint(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_delayed_payment_basepoint(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_delayed_payment_basepoint(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_delayed_payment_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_htlc_basepoint(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_basepoint(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_htlc_basepoint(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_htlc_basepoint(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_first_per_commitment_point(OpenChannel this_ptr) { - byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_first_per_commitment_point(OpenChannel this_ptr, byte[] val) { - bindings.OpenChannel_set_first_per_commitment_point(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_first_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte get_channel_flags(OpenChannel this_ptr) { - byte ret = bindings.OpenChannel_get_channel_flags(this_ptr.ptr & ~1); + byte ret = bindings.OpenChannel_get_channel_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_flags(OpenChannel this_ptr, byte val) { - bindings.OpenChannel_set_channel_flags(this_ptr.ptr & ~1, val); + bindings.OpenChannel_set_channel_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index aabd0d23..18229e76 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -11,29 +11,29 @@ public class OutPoint extends CommonBase { } public OutPoint(OutPoint orig) { - super(bindings.OutPoint_clone(orig.ptr & ~1)); + super(bindings.OutPoint_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_txid(OutPoint this_ptr) { - byte[] ret = bindings.OutPoint_get_txid(this_ptr.ptr & ~1); + byte[] ret = bindings.OutPoint_get_txid(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_txid(OutPoint this_ptr, byte[] val) { - bindings.OutPoint_set_txid(this_ptr.ptr & ~1, val); + bindings.OutPoint_set_txid(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_index(OutPoint this_ptr) { - short ret = bindings.OutPoint_get_index(this_ptr.ptr & ~1); + short ret = bindings.OutPoint_get_index(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_index(OutPoint this_ptr, short val) { - bindings.OutPoint_set_index(this_ptr.ptr & ~1, val); + bindings.OutPoint_set_index(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/PeerHandleError.java b/src/main/java/org/ldk/structs/PeerHandleError.java index 391cb470..24c350e8 100644 --- a/src/main/java/org/ldk/structs/PeerHandleError.java +++ b/src/main/java/org/ldk/structs/PeerHandleError.java @@ -11,13 +11,13 @@ public class PeerHandleError extends CommonBase { } public boolean get_no_connection_possible(PeerHandleError this_ptr) { - boolean ret = bindings.PeerHandleError_get_no_connection_possible(this_ptr.ptr & ~1); + boolean ret = bindings.PeerHandleError_get_no_connection_possible(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_no_connection_possible(PeerHandleError this_ptr, boolean val) { - bindings.PeerHandleError_set_no_connection_possible(this_ptr.ptr & ~1, val); + bindings.PeerHandleError_set_no_connection_possible(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index 81d89509..62e50eed 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -11,7 +11,7 @@ public class PeerManager extends CommonBase { } public PeerManager(MessageHandler message_handler, byte[] our_node_secret, byte[] ephemeral_random_data, Logger logger) { - super(bindings.PeerManager_new(message_handler.ptr & ~1, our_node_secret, ephemeral_random_data, logger.ptr)); + super(bindings.PeerManager_new(message_handler == null ? 0 : message_handler.ptr & ~1, our_node_secret, ephemeral_random_data, logger == null ? 0 : logger.ptr)); this.ptrs_to.add(message_handler); this.ptrs_to.add(logger); } @@ -26,7 +26,7 @@ public class PeerManager extends CommonBase { } public void socket_disconnected(SocketDescriptor descriptor) { - bindings.PeerManager_socket_disconnected(this.ptr, descriptor.ptr); + bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : descriptor.ptr); this.ptrs_to.add(descriptor); } diff --git a/src/main/java/org/ldk/structs/Ping.java b/src/main/java/org/ldk/structs/Ping.java index fed9c343..e0e1b3d5 100644 --- a/src/main/java/org/ldk/structs/Ping.java +++ b/src/main/java/org/ldk/structs/Ping.java @@ -11,29 +11,29 @@ public class Ping extends CommonBase { } public Ping(Ping orig) { - super(bindings.Ping_clone(orig.ptr & ~1)); + super(bindings.Ping_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public short get_ponglen(Ping this_ptr) { - short ret = bindings.Ping_get_ponglen(this_ptr.ptr & ~1); + short ret = bindings.Ping_get_ponglen(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_ponglen(Ping this_ptr, short val) { - bindings.Ping_set_ponglen(this_ptr.ptr & ~1, val); + bindings.Ping_set_ponglen(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_byteslen(Ping this_ptr) { - short ret = bindings.Ping_get_byteslen(this_ptr.ptr & ~1); + short ret = bindings.Ping_get_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_byteslen(Ping this_ptr, short val) { - bindings.Ping_set_byteslen(this_ptr.ptr & ~1, val); + bindings.Ping_set_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/Pong.java b/src/main/java/org/ldk/structs/Pong.java index fc98b396..0ddec80c 100644 --- a/src/main/java/org/ldk/structs/Pong.java +++ b/src/main/java/org/ldk/structs/Pong.java @@ -11,18 +11,18 @@ public class Pong extends CommonBase { } public Pong(Pong orig) { - super(bindings.Pong_clone(orig.ptr & ~1)); + super(bindings.Pong_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public short get_byteslen(Pong this_ptr) { - short ret = bindings.Pong_get_byteslen(this_ptr.ptr & ~1); + short ret = bindings.Pong_get_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_byteslen(Pong this_ptr, short val) { - bindings.Pong_set_byteslen(this_ptr.ptr & ~1, val); + bindings.Pong_set_byteslen(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/PreCalculatedTxCreationKeys.java b/src/main/java/org/ldk/structs/PreCalculatedTxCreationKeys.java index 45c8c29e..2a88b869 100644 --- a/src/main/java/org/ldk/structs/PreCalculatedTxCreationKeys.java +++ b/src/main/java/org/ldk/structs/PreCalculatedTxCreationKeys.java @@ -11,7 +11,7 @@ public class PreCalculatedTxCreationKeys extends CommonBase { } public PreCalculatedTxCreationKeys(TxCreationKeys keys) { - super(bindings.PreCalculatedTxCreationKeys_new(keys.ptr & ~1)); + super(bindings.PreCalculatedTxCreationKeys_new(keys == null ? 0 : keys.ptr & ~1)); this.ptrs_to.add(keys); } diff --git a/src/main/java/org/ldk/structs/QueryChannelRange.java b/src/main/java/org/ldk/structs/QueryChannelRange.java index 70491a4d..c1a8b3f2 100644 --- a/src/main/java/org/ldk/structs/QueryChannelRange.java +++ b/src/main/java/org/ldk/structs/QueryChannelRange.java @@ -11,40 +11,40 @@ public class QueryChannelRange extends CommonBase { } public QueryChannelRange(QueryChannelRange orig) { - super(bindings.QueryChannelRange_clone(orig.ptr & ~1)); + super(bindings.QueryChannelRange_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_chain_hash(QueryChannelRange this_ptr) { - byte[] ret = bindings.QueryChannelRange_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.QueryChannelRange_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(QueryChannelRange this_ptr, byte[] val) { - bindings.QueryChannelRange_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.QueryChannelRange_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_first_blocknum(QueryChannelRange this_ptr) { - int ret = bindings.QueryChannelRange_get_first_blocknum(this_ptr.ptr & ~1); + int ret = bindings.QueryChannelRange_get_first_blocknum(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_first_blocknum(QueryChannelRange this_ptr, int val) { - bindings.QueryChannelRange_set_first_blocknum(this_ptr.ptr & ~1, val); + bindings.QueryChannelRange_set_first_blocknum(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_number_of_blocks(QueryChannelRange this_ptr) { - int ret = bindings.QueryChannelRange_get_number_of_blocks(this_ptr.ptr & ~1); + int ret = bindings.QueryChannelRange_get_number_of_blocks(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_number_of_blocks(QueryChannelRange this_ptr, int val) { - bindings.QueryChannelRange_set_number_of_blocks(this_ptr.ptr & ~1, val); + bindings.QueryChannelRange_set_number_of_blocks(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/QueryShortChannelIds.java b/src/main/java/org/ldk/structs/QueryShortChannelIds.java index 68cc1304..316e4f94 100644 --- a/src/main/java/org/ldk/structs/QueryShortChannelIds.java +++ b/src/main/java/org/ldk/structs/QueryShortChannelIds.java @@ -11,18 +11,18 @@ public class QueryShortChannelIds extends CommonBase { } public QueryShortChannelIds(QueryShortChannelIds orig) { - super(bindings.QueryShortChannelIds_clone(orig.ptr & ~1)); + super(bindings.QueryShortChannelIds_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_chain_hash(QueryShortChannelIds this_ptr) { - byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(QueryShortChannelIds this_ptr, byte[] val) { - bindings.QueryShortChannelIds_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.QueryShortChannelIds_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index 5457ced5..43ccf5d2 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.java @@ -11,51 +11,51 @@ public class ReplyChannelRange extends CommonBase { } public ReplyChannelRange(ReplyChannelRange orig) { - super(bindings.ReplyChannelRange_clone(orig.ptr & ~1)); + super(bindings.ReplyChannelRange_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_chain_hash(ReplyChannelRange this_ptr) { - byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(ReplyChannelRange this_ptr, byte[] val) { - bindings.ReplyChannelRange_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.ReplyChannelRange_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_first_blocknum(ReplyChannelRange this_ptr) { - int ret = bindings.ReplyChannelRange_get_first_blocknum(this_ptr.ptr & ~1); + int ret = bindings.ReplyChannelRange_get_first_blocknum(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_first_blocknum(ReplyChannelRange this_ptr, int val) { - bindings.ReplyChannelRange_set_first_blocknum(this_ptr.ptr & ~1, val); + bindings.ReplyChannelRange_set_first_blocknum(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_number_of_blocks(ReplyChannelRange this_ptr) { - int ret = bindings.ReplyChannelRange_get_number_of_blocks(this_ptr.ptr & ~1); + int ret = bindings.ReplyChannelRange_get_number_of_blocks(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_number_of_blocks(ReplyChannelRange this_ptr, int val) { - bindings.ReplyChannelRange_set_number_of_blocks(this_ptr.ptr & ~1, val); + bindings.ReplyChannelRange_set_number_of_blocks(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public boolean get_full_information(ReplyChannelRange this_ptr) { - boolean ret = bindings.ReplyChannelRange_get_full_information(this_ptr.ptr & ~1); + boolean ret = bindings.ReplyChannelRange_get_full_information(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_full_information(ReplyChannelRange this_ptr, boolean val) { - bindings.ReplyChannelRange_set_full_information(this_ptr.ptr & ~1, val); + bindings.ReplyChannelRange_set_full_information(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java index 895988fa..c04cd58a 100644 --- a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java +++ b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java @@ -11,29 +11,29 @@ public class ReplyShortChannelIdsEnd extends CommonBase { } public ReplyShortChannelIdsEnd(ReplyShortChannelIdsEnd orig) { - super(bindings.ReplyShortChannelIdsEnd_clone(orig.ptr & ~1)); + super(bindings.ReplyShortChannelIdsEnd_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_chain_hash(ReplyShortChannelIdsEnd this_ptr) { - byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(ReplyShortChannelIdsEnd this_ptr, byte[] val) { - bindings.ReplyShortChannelIdsEnd_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.ReplyShortChannelIdsEnd_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public boolean get_full_information(ReplyShortChannelIdsEnd this_ptr) { - boolean ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this_ptr.ptr & ~1); + boolean ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_full_information(ReplyShortChannelIdsEnd this_ptr, boolean val) { - bindings.ReplyShortChannelIdsEnd_set_full_information(this_ptr.ptr & ~1, val); + bindings.ReplyShortChannelIdsEnd_set_full_information(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/RevokeAndACK.java b/src/main/java/org/ldk/structs/RevokeAndACK.java index 514ded4b..d887797c 100644 --- a/src/main/java/org/ldk/structs/RevokeAndACK.java +++ b/src/main/java/org/ldk/structs/RevokeAndACK.java @@ -11,40 +11,40 @@ public class RevokeAndACK extends CommonBase { } public RevokeAndACK(RevokeAndACK orig) { - super(bindings.RevokeAndACK_clone(orig.ptr & ~1)); + super(bindings.RevokeAndACK_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(RevokeAndACK this_ptr) { - byte[] ret = bindings.RevokeAndACK_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.RevokeAndACK_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(RevokeAndACK this_ptr, byte[] val) { - bindings.RevokeAndACK_set_channel_id(this_ptr.ptr & ~1, val); + bindings.RevokeAndACK_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_per_commitment_secret(RevokeAndACK this_ptr) { - byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this_ptr.ptr & ~1); + byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_per_commitment_secret(RevokeAndACK this_ptr, byte[] val) { - bindings.RevokeAndACK_set_per_commitment_secret(this_ptr.ptr & ~1, val); + bindings.RevokeAndACK_set_per_commitment_secret(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_next_per_commitment_point(RevokeAndACK this_ptr) { - byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_next_per_commitment_point(RevokeAndACK this_ptr, byte[] val) { - bindings.RevokeAndACK_set_next_per_commitment_point(this_ptr.ptr & ~1, val); + bindings.RevokeAndACK_set_next_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index fe20cede..dc1f9645 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -11,7 +11,7 @@ public class Route extends CommonBase { } public Route(Route orig) { - super(bindings.Route_clone(orig.ptr & ~1)); + super(bindings.Route_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } diff --git a/src/main/java/org/ldk/structs/RouteHint.java b/src/main/java/org/ldk/structs/RouteHint.java index 52112e66..71fdc7fe 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -11,68 +11,68 @@ public class RouteHint extends CommonBase { } public RouteHint(RouteHint orig) { - super(bindings.RouteHint_clone(orig.ptr & ~1)); + super(bindings.RouteHint_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_src_node_id(RouteHint this_ptr) { - byte[] ret = bindings.RouteHint_get_src_node_id(this_ptr.ptr & ~1); + byte[] ret = bindings.RouteHint_get_src_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_src_node_id(RouteHint this_ptr, byte[] val) { - bindings.RouteHint_set_src_node_id(this_ptr.ptr & ~1, val); + bindings.RouteHint_set_src_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_short_channel_id(RouteHint this_ptr) { - long ret = bindings.RouteHint_get_short_channel_id(this_ptr.ptr & ~1); + long ret = bindings.RouteHint_get_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_short_channel_id(RouteHint this_ptr, long val) { - bindings.RouteHint_set_short_channel_id(this_ptr.ptr & ~1, val); + bindings.RouteHint_set_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public RoutingFees get_fees(RouteHint this_ptr) { - RoutingFees ret = new RoutingFees(null, bindings.RouteHint_get_fees(this_ptr.ptr & ~1)); + RoutingFees ret = new RoutingFees(null, bindings.RouteHint_get_fees(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_fees(RouteHint this_ptr, RoutingFees val) { - bindings.RouteHint_set_fees(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.RouteHint_set_fees(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public short get_cltv_expiry_delta(RouteHint this_ptr) { - short ret = bindings.RouteHint_get_cltv_expiry_delta(this_ptr.ptr & ~1); + short ret = bindings.RouteHint_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_cltv_expiry_delta(RouteHint this_ptr, short val) { - bindings.RouteHint_set_cltv_expiry_delta(this_ptr.ptr & ~1, val); + bindings.RouteHint_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_minimum_msat(RouteHint this_ptr) { - long ret = bindings.RouteHint_get_htlc_minimum_msat(this_ptr.ptr & ~1); + long ret = bindings.RouteHint_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_minimum_msat(RouteHint this_ptr, long val) { - bindings.RouteHint_set_htlc_minimum_msat(this_ptr.ptr & ~1, val); + bindings.RouteHint_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public RouteHint(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg) { - super(bindings.RouteHint_new(src_node_id_arg, short_channel_id_arg, fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg)); + super(bindings.RouteHint_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg)); this.ptrs_to.add(fees_arg); } diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index 496e4eb0..54210f7c 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -11,80 +11,80 @@ public class RouteHop extends CommonBase { } public RouteHop(RouteHop orig) { - super(bindings.RouteHop_clone(orig.ptr & ~1)); + super(bindings.RouteHop_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_pubkey(RouteHop this_ptr) { - byte[] ret = bindings.RouteHop_get_pubkey(this_ptr.ptr & ~1); + byte[] ret = bindings.RouteHop_get_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_pubkey(RouteHop this_ptr, byte[] val) { - bindings.RouteHop_set_pubkey(this_ptr.ptr & ~1, val); + bindings.RouteHop_set_pubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public NodeFeatures get_node_features(RouteHop this_ptr) { - NodeFeatures ret = new NodeFeatures(null, bindings.RouteHop_get_node_features(this_ptr.ptr & ~1)); + NodeFeatures ret = new NodeFeatures(null, bindings.RouteHop_get_node_features(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_node_features(RouteHop this_ptr, NodeFeatures val) { - bindings.RouteHop_set_node_features(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.RouteHop_set_node_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public long get_short_channel_id(RouteHop this_ptr) { - long ret = bindings.RouteHop_get_short_channel_id(this_ptr.ptr & ~1); + long ret = bindings.RouteHop_get_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_short_channel_id(RouteHop this_ptr, long val) { - bindings.RouteHop_set_short_channel_id(this_ptr.ptr & ~1, val); + bindings.RouteHop_set_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public ChannelFeatures get_channel_features(RouteHop this_ptr) { - ChannelFeatures ret = new ChannelFeatures(null, bindings.RouteHop_get_channel_features(this_ptr.ptr & ~1)); + ChannelFeatures ret = new ChannelFeatures(null, bindings.RouteHop_get_channel_features(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_features(RouteHop this_ptr, ChannelFeatures val) { - bindings.RouteHop_set_channel_features(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.RouteHop_set_channel_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public long get_fee_msat(RouteHop this_ptr) { - long ret = bindings.RouteHop_get_fee_msat(this_ptr.ptr & ~1); + long ret = bindings.RouteHop_get_fee_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_fee_msat(RouteHop this_ptr, long val) { - bindings.RouteHop_set_fee_msat(this_ptr.ptr & ~1, val); + bindings.RouteHop_set_fee_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_cltv_expiry_delta(RouteHop this_ptr) { - int ret = bindings.RouteHop_get_cltv_expiry_delta(this_ptr.ptr & ~1); + int ret = bindings.RouteHop_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_cltv_expiry_delta(RouteHop this_ptr, int val) { - bindings.RouteHop_set_cltv_expiry_delta(this_ptr.ptr & ~1, val); + bindings.RouteHop_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public RouteHop(byte[] pubkey_arg, NodeFeatures node_features_arg, long short_channel_id_arg, ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) { - super(bindings.RouteHop_new(pubkey_arg, node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg)); + super(bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg)); this.ptrs_to.add(node_features_arg); this.ptrs_to.add(channel_features_arg); } diff --git a/src/main/java/org/ldk/structs/RoutingFees.java b/src/main/java/org/ldk/structs/RoutingFees.java index 215372fa..59f65ce5 100644 --- a/src/main/java/org/ldk/structs/RoutingFees.java +++ b/src/main/java/org/ldk/structs/RoutingFees.java @@ -11,29 +11,29 @@ public class RoutingFees extends CommonBase { } public RoutingFees(RoutingFees orig) { - super(bindings.RoutingFees_clone(orig.ptr & ~1)); + super(bindings.RoutingFees_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public int get_base_msat(RoutingFees this_ptr) { - int ret = bindings.RoutingFees_get_base_msat(this_ptr.ptr & ~1); + int ret = bindings.RoutingFees_get_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_base_msat(RoutingFees this_ptr, int val) { - bindings.RoutingFees_set_base_msat(this_ptr.ptr & ~1, val); + bindings.RoutingFees_set_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_proportional_millionths(RoutingFees this_ptr) { - int ret = bindings.RoutingFees_get_proportional_millionths(this_ptr.ptr & ~1); + int ret = bindings.RoutingFees_get_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_proportional_millionths(RoutingFees this_ptr, int val) { - bindings.RoutingFees_set_proportional_millionths(this_ptr.ptr & ~1, val); + bindings.RoutingFees_set_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/Shutdown.java b/src/main/java/org/ldk/structs/Shutdown.java index 09f1d36f..8c690a9d 100644 --- a/src/main/java/org/ldk/structs/Shutdown.java +++ b/src/main/java/org/ldk/structs/Shutdown.java @@ -11,23 +11,23 @@ public class Shutdown extends CommonBase { } public Shutdown(Shutdown orig) { - super(bindings.Shutdown_clone(orig.ptr & ~1)); + super(bindings.Shutdown_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(Shutdown this_ptr) { - byte[] ret = bindings.Shutdown_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.Shutdown_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(Shutdown this_ptr, byte[] val) { - bindings.Shutdown_set_channel_id(this_ptr.ptr & ~1, val); + bindings.Shutdown_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_scriptpubkey(Shutdown this_ptr) { - byte[] ret = bindings.Shutdown_get_scriptpubkey(this_ptr.ptr & ~1); + byte[] ret = bindings.Shutdown_get_scriptpubkey(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } diff --git a/src/main/java/org/ldk/structs/TxCreationKeys.java b/src/main/java/org/ldk/structs/TxCreationKeys.java index 33132b80..39849ae5 100644 --- a/src/main/java/org/ldk/structs/TxCreationKeys.java +++ b/src/main/java/org/ldk/structs/TxCreationKeys.java @@ -11,62 +11,62 @@ public class TxCreationKeys extends CommonBase { } public TxCreationKeys(TxCreationKeys orig) { - super(bindings.TxCreationKeys_clone(orig.ptr & ~1)); + super(bindings.TxCreationKeys_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_per_commitment_point(TxCreationKeys this_ptr) { - byte[] ret = bindings.TxCreationKeys_get_per_commitment_point(this_ptr.ptr & ~1); + byte[] ret = bindings.TxCreationKeys_get_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_per_commitment_point(TxCreationKeys this_ptr, byte[] val) { - bindings.TxCreationKeys_set_per_commitment_point(this_ptr.ptr & ~1, val); + bindings.TxCreationKeys_set_per_commitment_point(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_revocation_key(TxCreationKeys this_ptr) { - byte[] ret = bindings.TxCreationKeys_get_revocation_key(this_ptr.ptr & ~1); + byte[] ret = bindings.TxCreationKeys_get_revocation_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_revocation_key(TxCreationKeys this_ptr, byte[] val) { - bindings.TxCreationKeys_set_revocation_key(this_ptr.ptr & ~1, val); + bindings.TxCreationKeys_set_revocation_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_broadcaster_htlc_key(TxCreationKeys this_ptr) { - byte[] ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this_ptr.ptr & ~1); + byte[] ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_broadcaster_htlc_key(TxCreationKeys this_ptr, byte[] val) { - bindings.TxCreationKeys_set_broadcaster_htlc_key(this_ptr.ptr & ~1, val); + bindings.TxCreationKeys_set_broadcaster_htlc_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_countersignatory_htlc_key(TxCreationKeys this_ptr) { - byte[] ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this_ptr.ptr & ~1); + byte[] ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_countersignatory_htlc_key(TxCreationKeys this_ptr, byte[] val) { - bindings.TxCreationKeys_set_countersignatory_htlc_key(this_ptr.ptr & ~1, val); + bindings.TxCreationKeys_set_countersignatory_htlc_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_broadcaster_delayed_payment_key(TxCreationKeys this_ptr) { - byte[] ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr.ptr & ~1); + byte[] ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_broadcaster_delayed_payment_key(TxCreationKeys this_ptr, byte[] val) { - bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr.ptr & ~1, val); + bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java index 60c4042b..2d80ea4c 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -11,85 +11,85 @@ public class UnsignedChannelAnnouncement extends CommonBase { } public UnsignedChannelAnnouncement(UnsignedChannelAnnouncement orig) { - super(bindings.UnsignedChannelAnnouncement_clone(orig.ptr & ~1)); + super(bindings.UnsignedChannelAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public ChannelFeatures get_features(UnsignedChannelAnnouncement this_ptr) { - ChannelFeatures ret = new ChannelFeatures(null, bindings.UnsignedChannelAnnouncement_get_features(this_ptr.ptr & ~1)); + ChannelFeatures ret = new ChannelFeatures(null, bindings.UnsignedChannelAnnouncement_get_features(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_features(UnsignedChannelAnnouncement this_ptr, ChannelFeatures val) { - bindings.UnsignedChannelAnnouncement_set_features(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.UnsignedChannelAnnouncement_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public byte[] get_chain_hash(UnsignedChannelAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(UnsignedChannelAnnouncement this_ptr, byte[] val) { - bindings.UnsignedChannelAnnouncement_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelAnnouncement_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_short_channel_id(UnsignedChannelAnnouncement this_ptr) { - long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this_ptr.ptr & ~1); + long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_short_channel_id(UnsignedChannelAnnouncement this_ptr, long val) { - bindings.UnsignedChannelAnnouncement_set_short_channel_id(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelAnnouncement_set_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_node_id_1(UnsignedChannelAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_id_1(UnsignedChannelAnnouncement this_ptr, byte[] val) { - bindings.UnsignedChannelAnnouncement_set_node_id_1(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelAnnouncement_set_node_id_1(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_node_id_2(UnsignedChannelAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_id_2(UnsignedChannelAnnouncement this_ptr, byte[] val) { - bindings.UnsignedChannelAnnouncement_set_node_id_2(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelAnnouncement_set_node_id_2(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_bitcoin_key_1(UnsignedChannelAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_bitcoin_key_1(UnsignedChannelAnnouncement this_ptr, byte[] val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_bitcoin_key_2(UnsignedChannelAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_bitcoin_key_2(UnsignedChannelAnnouncement this_ptr, byte[] val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index 91479088..f56cca90 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java @@ -11,95 +11,95 @@ public class UnsignedChannelUpdate extends CommonBase { } public UnsignedChannelUpdate(UnsignedChannelUpdate orig) { - super(bindings.UnsignedChannelUpdate_clone(orig.ptr & ~1)); + super(bindings.UnsignedChannelUpdate_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_chain_hash(UnsignedChannelUpdate this_ptr) { - byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_chain_hash(UnsignedChannelUpdate this_ptr, byte[] val) { - bindings.UnsignedChannelUpdate_set_chain_hash(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_chain_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_short_channel_id(UnsignedChannelUpdate this_ptr) { - long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this_ptr.ptr & ~1); + long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_short_channel_id(UnsignedChannelUpdate this_ptr, long val) { - bindings.UnsignedChannelUpdate_set_short_channel_id(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_short_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_timestamp(UnsignedChannelUpdate this_ptr) { - int ret = bindings.UnsignedChannelUpdate_get_timestamp(this_ptr.ptr & ~1); + int ret = bindings.UnsignedChannelUpdate_get_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_timestamp(UnsignedChannelUpdate this_ptr, int val) { - bindings.UnsignedChannelUpdate_set_timestamp(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte get_flags(UnsignedChannelUpdate this_ptr) { - byte ret = bindings.UnsignedChannelUpdate_get_flags(this_ptr.ptr & ~1); + byte ret = bindings.UnsignedChannelUpdate_get_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_flags(UnsignedChannelUpdate this_ptr, byte val) { - bindings.UnsignedChannelUpdate_set_flags(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_flags(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_cltv_expiry_delta(UnsignedChannelUpdate this_ptr) { - short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr.ptr & ~1); + short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_cltv_expiry_delta(UnsignedChannelUpdate this_ptr, short val) { - bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_minimum_msat(UnsignedChannelUpdate this_ptr) { - long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr.ptr & ~1); + long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_minimum_msat(UnsignedChannelUpdate this_ptr, long val) { - bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_fee_base_msat(UnsignedChannelUpdate this_ptr) { - int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this_ptr.ptr & ~1); + int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_fee_base_msat(UnsignedChannelUpdate this_ptr, int val) { - bindings.UnsignedChannelUpdate_set_fee_base_msat(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_fee_base_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_fee_proportional_millionths(UnsignedChannelUpdate this_ptr) { - int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr.ptr & ~1); + int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_fee_proportional_millionths(UnsignedChannelUpdate this_ptr, int val) { - bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr.ptr & ~1, val); + bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index 51d93e35..828432ec 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -11,63 +11,63 @@ public class UnsignedNodeAnnouncement extends CommonBase { } public UnsignedNodeAnnouncement(UnsignedNodeAnnouncement orig) { - super(bindings.UnsignedNodeAnnouncement_clone(orig.ptr & ~1)); + super(bindings.UnsignedNodeAnnouncement_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public NodeFeatures get_features(UnsignedNodeAnnouncement this_ptr) { - NodeFeatures ret = new NodeFeatures(null, bindings.UnsignedNodeAnnouncement_get_features(this_ptr.ptr & ~1)); + NodeFeatures ret = new NodeFeatures(null, bindings.UnsignedNodeAnnouncement_get_features(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_features(UnsignedNodeAnnouncement this_ptr, NodeFeatures val) { - bindings.UnsignedNodeAnnouncement_set_features(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.UnsignedNodeAnnouncement_set_features(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public int get_timestamp(UnsignedNodeAnnouncement this_ptr) { - int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this_ptr.ptr & ~1); + int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_timestamp(UnsignedNodeAnnouncement this_ptr, int val) { - bindings.UnsignedNodeAnnouncement_set_timestamp(this_ptr.ptr & ~1, val); + bindings.UnsignedNodeAnnouncement_set_timestamp(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_node_id(UnsignedNodeAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_node_id(UnsignedNodeAnnouncement this_ptr, byte[] val) { - bindings.UnsignedNodeAnnouncement_set_node_id(this_ptr.ptr & ~1, val); + bindings.UnsignedNodeAnnouncement_set_node_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_rgb(UnsignedNodeAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_rgb(UnsignedNodeAnnouncement this_ptr, byte[] val) { - bindings.UnsignedNodeAnnouncement_set_rgb(this_ptr.ptr & ~1, val); + bindings.UnsignedNodeAnnouncement_set_rgb(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_alias(UnsignedNodeAnnouncement this_ptr) { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this_ptr.ptr & ~1); + byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_alias(UnsignedNodeAnnouncement this_ptr, byte[] val) { - bindings.UnsignedNodeAnnouncement_set_alias(this_ptr.ptr & ~1, val); + bindings.UnsignedNodeAnnouncement_set_alias(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index fd9d3e08..adca17e6 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -11,62 +11,62 @@ public class UpdateAddHTLC extends CommonBase { } public UpdateAddHTLC(UpdateAddHTLC orig) { - super(bindings.UpdateAddHTLC_clone(orig.ptr & ~1)); + super(bindings.UpdateAddHTLC_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(UpdateAddHTLC this_ptr) { - byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(UpdateAddHTLC this_ptr, byte[] val) { - bindings.UpdateAddHTLC_set_channel_id(this_ptr.ptr & ~1, val); + bindings.UpdateAddHTLC_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_id(UpdateAddHTLC this_ptr) { - long ret = bindings.UpdateAddHTLC_get_htlc_id(this_ptr.ptr & ~1); + long ret = bindings.UpdateAddHTLC_get_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_id(UpdateAddHTLC this_ptr, long val) { - bindings.UpdateAddHTLC_set_htlc_id(this_ptr.ptr & ~1, val); + bindings.UpdateAddHTLC_set_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_amount_msat(UpdateAddHTLC this_ptr) { - long ret = bindings.UpdateAddHTLC_get_amount_msat(this_ptr.ptr & ~1); + long ret = bindings.UpdateAddHTLC_get_amount_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_amount_msat(UpdateAddHTLC this_ptr, long val) { - bindings.UpdateAddHTLC_set_amount_msat(this_ptr.ptr & ~1, val); + bindings.UpdateAddHTLC_set_amount_msat(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_payment_hash(UpdateAddHTLC this_ptr) { - byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_payment_hash(UpdateAddHTLC this_ptr, byte[] val) { - bindings.UpdateAddHTLC_set_payment_hash(this_ptr.ptr & ~1, val); + bindings.UpdateAddHTLC_set_payment_hash(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_cltv_expiry(UpdateAddHTLC this_ptr) { - int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this_ptr.ptr & ~1); + int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_cltv_expiry(UpdateAddHTLC this_ptr, int val) { - bindings.UpdateAddHTLC_set_cltv_expiry(this_ptr.ptr & ~1, val); + bindings.UpdateAddHTLC_set_cltv_expiry(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index edc4e8cc..b1cb0329 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -11,29 +11,29 @@ public class UpdateFailHTLC extends CommonBase { } public UpdateFailHTLC(UpdateFailHTLC orig) { - super(bindings.UpdateFailHTLC_clone(orig.ptr & ~1)); + super(bindings.UpdateFailHTLC_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(UpdateFailHTLC this_ptr) { - byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(UpdateFailHTLC this_ptr, byte[] val) { - bindings.UpdateFailHTLC_set_channel_id(this_ptr.ptr & ~1, val); + bindings.UpdateFailHTLC_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_id(UpdateFailHTLC this_ptr) { - long ret = bindings.UpdateFailHTLC_get_htlc_id(this_ptr.ptr & ~1); + long ret = bindings.UpdateFailHTLC_get_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_id(UpdateFailHTLC this_ptr, long val) { - bindings.UpdateFailHTLC_set_htlc_id(this_ptr.ptr & ~1, val); + bindings.UpdateFailHTLC_set_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java index 209cd0cc..8f414a98 100644 --- a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java @@ -11,40 +11,40 @@ public class UpdateFailMalformedHTLC extends CommonBase { } public UpdateFailMalformedHTLC(UpdateFailMalformedHTLC orig) { - super(bindings.UpdateFailMalformedHTLC_clone(orig.ptr & ~1)); + super(bindings.UpdateFailMalformedHTLC_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(UpdateFailMalformedHTLC this_ptr) { - byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(UpdateFailMalformedHTLC this_ptr, byte[] val) { - bindings.UpdateFailMalformedHTLC_set_channel_id(this_ptr.ptr & ~1, val); + bindings.UpdateFailMalformedHTLC_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_id(UpdateFailMalformedHTLC this_ptr) { - long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this_ptr.ptr & ~1); + long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_id(UpdateFailMalformedHTLC this_ptr, long val) { - bindings.UpdateFailMalformedHTLC_set_htlc_id(this_ptr.ptr & ~1, val); + bindings.UpdateFailMalformedHTLC_set_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public short get_failure_code(UpdateFailMalformedHTLC this_ptr) { - short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this_ptr.ptr & ~1); + short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_failure_code(UpdateFailMalformedHTLC this_ptr, short val) { - bindings.UpdateFailMalformedHTLC_set_failure_code(this_ptr.ptr & ~1, val); + bindings.UpdateFailMalformedHTLC_set_failure_code(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index 43623fb0..9fd24408 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.java @@ -11,29 +11,29 @@ public class UpdateFee extends CommonBase { } public UpdateFee(UpdateFee orig) { - super(bindings.UpdateFee_clone(orig.ptr & ~1)); + super(bindings.UpdateFee_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(UpdateFee this_ptr) { - byte[] ret = bindings.UpdateFee_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateFee_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(UpdateFee this_ptr, byte[] val) { - bindings.UpdateFee_set_channel_id(this_ptr.ptr & ~1, val); + bindings.UpdateFee_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public int get_feerate_per_kw(UpdateFee this_ptr) { - int ret = bindings.UpdateFee_get_feerate_per_kw(this_ptr.ptr & ~1); + int ret = bindings.UpdateFee_get_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_feerate_per_kw(UpdateFee this_ptr, int val) { - bindings.UpdateFee_set_feerate_per_kw(this_ptr.ptr & ~1, val); + bindings.UpdateFee_set_feerate_per_kw(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index 3db67761..96f58430 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java @@ -11,40 +11,40 @@ public class UpdateFulfillHTLC extends CommonBase { } public UpdateFulfillHTLC(UpdateFulfillHTLC orig) { - super(bindings.UpdateFulfillHTLC_clone(orig.ptr & ~1)); + super(bindings.UpdateFulfillHTLC_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(UpdateFulfillHTLC this_ptr) { - byte[] ret = bindings.UpdateFulfillHTLC_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateFulfillHTLC_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(UpdateFulfillHTLC this_ptr, byte[] val) { - bindings.UpdateFulfillHTLC_set_channel_id(this_ptr.ptr & ~1, val); + bindings.UpdateFulfillHTLC_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_id(UpdateFulfillHTLC this_ptr) { - long ret = bindings.UpdateFulfillHTLC_get_htlc_id(this_ptr.ptr & ~1); + long ret = bindings.UpdateFulfillHTLC_get_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_id(UpdateFulfillHTLC this_ptr, long val) { - bindings.UpdateFulfillHTLC_set_htlc_id(this_ptr.ptr & ~1, val); + bindings.UpdateFulfillHTLC_set_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public byte[] get_payment_preimage(UpdateFulfillHTLC this_ptr) { - byte[] ret = bindings.UpdateFulfillHTLC_get_payment_preimage(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateFulfillHTLC_get_payment_preimage(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_payment_preimage(UpdateFulfillHTLC this_ptr, byte[] val) { - bindings.UpdateFulfillHTLC_set_payment_preimage(this_ptr.ptr & ~1, val); + bindings.UpdateFulfillHTLC_set_payment_preimage(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 0b1b072f..a22d021b 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -11,48 +11,48 @@ public class UserConfig extends CommonBase { } public UserConfig(UserConfig orig) { - super(bindings.UserConfig_clone(orig.ptr & ~1)); + super(bindings.UserConfig_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public ChannelHandshakeConfig get_own_channel_config(UserConfig this_ptr) { - ChannelHandshakeConfig ret = new ChannelHandshakeConfig(null, bindings.UserConfig_get_own_channel_config(this_ptr.ptr & ~1)); + ChannelHandshakeConfig ret = new ChannelHandshakeConfig(null, bindings.UserConfig_get_own_channel_config(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_own_channel_config(UserConfig this_ptr, ChannelHandshakeConfig val) { - bindings.UserConfig_set_own_channel_config(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.UserConfig_set_own_channel_config(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public ChannelHandshakeLimits get_peer_channel_config_limits(UserConfig this_ptr) { - ChannelHandshakeLimits ret = new ChannelHandshakeLimits(null, bindings.UserConfig_get_peer_channel_config_limits(this_ptr.ptr & ~1)); + ChannelHandshakeLimits ret = new ChannelHandshakeLimits(null, bindings.UserConfig_get_peer_channel_config_limits(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_peer_channel_config_limits(UserConfig this_ptr, ChannelHandshakeLimits val) { - bindings.UserConfig_set_peer_channel_config_limits(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.UserConfig_set_peer_channel_config_limits(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public ChannelConfig get_channel_options(UserConfig this_ptr) { - ChannelConfig ret = new ChannelConfig(null, bindings.UserConfig_get_channel_options(this_ptr.ptr & ~1)); + ChannelConfig ret = new ChannelConfig(null, bindings.UserConfig_get_channel_options(this_ptr == null ? 0 : this_ptr.ptr & ~1)); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_options(UserConfig this_ptr, ChannelConfig val) { - bindings.UserConfig_set_channel_options(this_ptr.ptr & ~1, val.ptr & ~1); + bindings.UserConfig_set_channel_options(this_ptr == null ? 0 : this_ptr.ptr & ~1, val == null ? 0 : val.ptr & ~1); this.ptrs_to.add(this_ptr); this.ptrs_to.add(val); } public UserConfig(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg) { - super(bindings.UserConfig_new(own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg.ptr & ~1, channel_options_arg.ptr & ~1)); + super(bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1)); this.ptrs_to.add(own_channel_config_arg); this.ptrs_to.add(peer_channel_config_limits_arg); this.ptrs_to.add(channel_options_arg); -- 2.39.5