projects
/
ldk-java
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Java] Update auto-generated bindings
[ldk-java]
/
src
/
main
/
java
/
org
/
ldk
/
structs
/
NetworkUpdate.java
diff --git
a/src/main/java/org/ldk/structs/NetworkUpdate.java
b/src/main/java/org/ldk/structs/NetworkUpdate.java
index 01e3614178b62ae8facb0b60404f3db414e4d966..0a85f072062ae04faaef81449ecbf7c6bfc0da2f 100644
(file)
--- a/
src/main/java/org/ldk/structs/NetworkUpdate.java
+++ b/
src/main/java/org/ldk/structs/NetworkUpdate.java
@@
-4,6
+4,7
@@
import org.ldk.impl.bindings;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
import javax.annotation.Nullable;
@@
-35,11
+36,15
@@
public class NetworkUpdate extends CommonBase {
assert false; return null; // Unreachable without extending the (internal) bindings interface
}
assert false; return null; // Unreachable without extending the (internal) bindings interface
}
+ /**
+ * An error indicating a `channel_update` messages should be applied via
+ * [`NetworkGraph::update_channel`].
+ */
public final static class ChannelUpdateMessage extends NetworkUpdate {
/**
* The update to apply via [`NetworkGraph::update_channel`].
*/
public final static class ChannelUpdateMessage extends NetworkUpdate {
/**
* The update to apply via [`NetworkGraph::update_channel`].
*/
- public final ChannelUpdate msg;
+ public final
org.ldk.structs.
ChannelUpdate msg;
private ChannelUpdateMessage(long ptr, bindings.LDKNetworkUpdate.ChannelUpdateMessage obj) {
super(null, ptr);
long msg = obj.msg;
private ChannelUpdateMessage(long ptr, bindings.LDKNetworkUpdate.ChannelUpdateMessage obj) {
super(null, ptr);
long msg = obj.msg;
@@
-48,6
+53,10
@@
public class NetworkUpdate extends CommonBase {
this.msg = msg_hu_conv;
}
}
this.msg = msg_hu_conv;
}
}
+ /**
+ * An error indicating only that a channel has been closed, which should be applied via
+ * [`NetworkGraph::close_channel_from_update`].
+ */
public final static class ChannelClosed extends NetworkUpdate {
/**
* The short channel id of the closed channel.
public final static class ChannelClosed extends NetworkUpdate {
/**
* The short channel id of the closed channel.
@@
-64,6
+73,10
@@
public class NetworkUpdate extends CommonBase {
this.is_permanent = obj.is_permanent;
}
}
this.is_permanent = obj.is_permanent;
}
}
+ /**
+ * An error indicating only that a node has failed, which should be applied via
+ * [`NetworkGraph::fail_node`].
+ */
public final static class NodeFailure extends NetworkUpdate {
/**
* The node id of the failed node.
public final static class NodeFailure extends NetworkUpdate {
/**
* The node id of the failed node.
@@
-80,13
+93,20
@@
public class NetworkUpdate extends CommonBase {
this.is_permanent = obj.is_permanent;
}
}
this.is_permanent = obj.is_permanent;
}
}
+ long clone_ptr() {
+ long ret = bindings.NetworkUpdate_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
/**
* Creates a copy of the NetworkUpdate
*/
public NetworkUpdate clone() {
long ret = bindings.NetworkUpdate_clone(this.ptr);
/**
* Creates a copy of the NetworkUpdate
*/
public NetworkUpdate clone() {
long ret = bindings.NetworkUpdate_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
if (ret >= 0 && ret <= 4096) { return null; }
-
NetworkUpdate ret_hu_conv =
NetworkUpdate.constr_from_ptr(ret);
+
org.ldk.structs.NetworkUpdate ret_hu_conv = org.ldk.structs.
NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
@@
-96,8
+116,9
@@
public class NetworkUpdate extends CommonBase {
*/
public static NetworkUpdate channel_update_message(ChannelUpdate msg) {
long ret = bindings.NetworkUpdate_channel_update_message(msg == null ? 0 : msg.ptr & ~1);
*/
public static NetworkUpdate channel_update_message(ChannelUpdate msg) {
long ret = bindings.NetworkUpdate_channel_update_message(msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
if (ret >= 0 && ret <= 4096) { return null; }
-
NetworkUpdate ret_hu_conv =
NetworkUpdate.constr_from_ptr(ret);
+
org.ldk.structs.NetworkUpdate ret_hu_conv = org.ldk.structs.
NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
@@
-107,8
+128,10
@@
public class NetworkUpdate extends CommonBase {
*/
public static NetworkUpdate channel_closed(long short_channel_id, boolean is_permanent) {
long ret = bindings.NetworkUpdate_channel_closed(short_channel_id, is_permanent);
*/
public static NetworkUpdate channel_closed(long short_channel_id, boolean is_permanent) {
long ret = bindings.NetworkUpdate_channel_closed(short_channel_id, is_permanent);
+ Reference.reachabilityFence(short_channel_id);
+ Reference.reachabilityFence(is_permanent);
if (ret >= 0 && ret <= 4096) { return null; }
if (ret >= 0 && ret <= 4096) { return null; }
-
NetworkUpdate ret_hu_conv =
NetworkUpdate.constr_from_ptr(ret);
+
org.ldk.structs.NetworkUpdate ret_hu_conv = org.ldk.structs.
NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
@@
-117,9
+140,11
@@
public class NetworkUpdate extends CommonBase {
* Utility method to constructs a new NodeFailure-variant NetworkUpdate
*/
public static NetworkUpdate node_failure(byte[] node_id, boolean is_permanent) {
* Utility method to constructs a new NodeFailure-variant NetworkUpdate
*/
public static NetworkUpdate node_failure(byte[] node_id, boolean is_permanent) {
- long ret = bindings.NetworkUpdate_node_failure(node_id, is_permanent);
+ long ret = bindings.NetworkUpdate_node_failure(InternalUtils.check_arr_len(node_id, 33), is_permanent);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(is_permanent);
if (ret >= 0 && ret <= 4096) { return null; }
if (ret >= 0 && ret <= 4096) { return null; }
-
NetworkUpdate ret_hu_conv =
NetworkUpdate.constr_from_ptr(ret);
+
org.ldk.structs.NetworkUpdate ret_hu_conv = org.ldk.structs.
NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
@@
-129,6
+154,7
@@
public class NetworkUpdate extends CommonBase {
*/
public byte[] write() {
byte[] ret = bindings.NetworkUpdate_write(this.ptr);
*/
public byte[] write() {
byte[] ret = bindings.NetworkUpdate_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
return ret;
}