projects
/
ldk-java
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #73 from TheBlueMatt/main
[ldk-java]
/
src
/
main
/
java
/
org
/
ldk
/
structs
/
OutPoint.java
diff --git
a/src/main/java/org/ldk/structs/OutPoint.java
b/src/main/java/org/ldk/structs/OutPoint.java
index edb136126a7d606f93cd3f0b8e3e3e83c589d591..5d6390e7488dc68e9b5fff9310c6ff29099a5534 100644
(file)
--- a/
src/main/java/org/ldk/structs/OutPoint.java
+++ b/
src/main/java/org/ldk/structs/OutPoint.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;
@@
-27,6
+28,7
@@
public class OutPoint extends CommonBase {
*/
public byte[] get_txid() {
byte[] ret = bindings.OutPoint_get_txid(this.ptr);
*/
public byte[] get_txid() {
byte[] ret = bindings.OutPoint_get_txid(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
return ret;
}
@@
-34,7
+36,9
@@
public class OutPoint extends CommonBase {
* The referenced transaction's txid.
*/
public void set_txid(byte[] val) {
* The referenced transaction's txid.
*/
public void set_txid(byte[] val) {
- bindings.OutPoint_set_txid(this.ptr, val);
+ bindings.OutPoint_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
}
/**
@@
-42,6
+46,7
@@
public class OutPoint extends CommonBase {
*/
public short get_index() {
short ret = bindings.OutPoint_get_index(this.ptr);
*/
public short get_index() {
short ret = bindings.OutPoint_get_index(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
return ret;
}
@@
-50,24
+55,35
@@
public class OutPoint extends CommonBase {
*/
public void set_index(short val) {
bindings.OutPoint_set_index(this.ptr, val);
*/
public void set_index(short val) {
bindings.OutPoint_set_index(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* Constructs a new OutPoint given each field
*/
public static OutPoint of(byte[] txid_arg, short index_arg) {
}
/**
* Constructs a new OutPoint given each field
*/
public static OutPoint of(byte[] txid_arg, short index_arg) {
- long ret = bindings.OutPoint_new(txid_arg, index_arg);
+ long ret = bindings.OutPoint_new(InternalUtils.check_arr_len(txid_arg, 32), index_arg);
+ Reference.reachabilityFence(txid_arg);
+ Reference.reachabilityFence(index_arg);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
+ long clone_ptr() {
+ long ret = bindings.OutPoint_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
/**
* Creates a copy of the OutPoint
*/
public OutPoint clone() {
long ret = bindings.OutPoint_clone(this.ptr);
/**
* Creates a copy of the OutPoint
*/
public OutPoint clone() {
long ret = bindings.OutPoint_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
@@
-81,23
+97,34
@@
public class OutPoint extends CommonBase {
*/
public boolean eq(OutPoint b) {
boolean ret = bindings.OutPoint_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
*/
public boolean eq(OutPoint b) {
boolean ret = bindings.OutPoint_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof OutPoint)) return false;
+ return this.eq((OutPoint)o);
+ }
/**
* Checks if two OutPoints contain equal inner contents.
*/
public long hash() {
long ret = bindings.OutPoint_hash(this.ptr);
/**
* Checks if two OutPoints contain equal inner contents.
*/
public long hash() {
long ret = bindings.OutPoint_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Convert an `OutPoint` to a lightning channel id.
*/
public byte[] to_channel_id() {
byte[] ret = bindings.OutPoint_to_channel_id(this.ptr);
/**
* Convert an `OutPoint` to a lightning channel id.
*/
public byte[] to_channel_id() {
byte[] ret = bindings.OutPoint_to_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
return ret;
}
@@
-106,6
+133,7
@@
public class OutPoint extends CommonBase {
*/
public byte[] write() {
byte[] ret = bindings.OutPoint_write(this.ptr);
*/
public byte[] write() {
byte[] ret = bindings.OutPoint_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
return ret;
}
@@
-114,6
+142,7
@@
public class OutPoint extends CommonBase {
*/
public static Result_OutPointDecodeErrorZ read(byte[] ser) {
long ret = bindings.OutPoint_read(ser);
*/
public static Result_OutPointDecodeErrorZ read(byte[] ser) {
long ret = bindings.OutPoint_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;