X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=java_strings.py;h=8338bc176156b056c77c367674faa9b37ff32996;hb=153c5653d39ca5dc40e4cd9bfbab41936b850768;hp=535646b94ad623ac0d2b8cbdd73fc83921954014;hpb=5526ec4b1668591b452f0fb19a8f33cacc6eebfd;p=ldk-java diff --git a/java_strings.py b/java_strings.py index 535646b9..8338bc17 100644 --- a/java_strings.py +++ b/java_strings.py @@ -121,6 +121,30 @@ class CommonBase { } """ + self.txout_defn = """public class TxOut extends CommonBase { + /** The script_pubkey in this output */ + public final byte[] script_pubkey; + /** The value, in satoshis, of this output */ + public final long value; + + TxOut(java.lang.Object _dummy, long ptr) { + super(ptr); + this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr); + this.value = bindings.TxOut_get_value(ptr); + } + public TxOut(long value, byte[] script_pubkey) { + super(bindings.TxOut_new(script_pubkey, value)); + this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr); + this.value = bindings.TxOut_get_value(ptr); + } + + @Override @SuppressWarnings(\"deprecation\") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.TxOut_free(ptr); } + } +}""" + self.c_file_pfx = """#include // On OSX jlong (ie long long) is not equivalent to int64_t, so we override here #define int64_t jlong