X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FTxOut.java;h=80b67a24358b325557eef77d8c6cb3b262f53bde;hb=db1a11032b4164540a2d3403696be12bbca70e94;hp=c3d2259e56be618cd26c6d6245d4ca39a89f253d;hpb=17113550a5fefab21f39f27fbfe02646b8db53ae;p=ldk-java diff --git a/src/main/java/org/ldk/structs/TxOut.java b/src/main/java/org/ldk/structs/TxOut.java index c3d2259e..80b67a24 100644 --- a/src/main/java/org/ldk/structs/TxOut.java +++ b/src/main/java/org/ldk/structs/TxOut.java @@ -4,13 +4,29 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; public class TxOut extends CommonBase{ - TxOut(java.lang.Object _dummy, long ptr) { super(ptr); } - long to_c_ptr() { return 0; } + /** 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); } } + } \ No newline at end of file