Package org.ldk.structs
Class Utxo
- java.lang.Object
-
- org.ldk.structs.Utxo
-
public class Utxo extends Object
An unspent transaction output that is available to spend resulting from a successful [`CoinSelection`] attempt.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Utxoclone()Creates a copy of the Utxobooleaneq(Utxo b)Checks if two Utxos contain equal inner contents.booleanequals(Object o)protected voidfinalize()OutPointget_outpoint()The unique identifier of the output.TxOutget_output()The output to spend.longget_satisfaction_weight()The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each with their lengths included, required to satisfy the output's script.longhash()Generates a non-cryptographic 64-bit hash of the Utxo.inthashCode()static Utxonew_p2pkh(OutPoint outpoint, long value, byte[] pubkey_hash)Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.static Utxoof(OutPoint outpoint_arg, TxOut output_arg, long satisfaction_weight_arg)Constructs a new Utxo given each fieldvoidset_outpoint(OutPoint val)The unique identifier of the output.voidset_output(TxOut val)The output to spend.voidset_satisfaction_weight(long val)The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each with their lengths included, required to satisfy the output's script.
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_outpoint
public OutPoint get_outpoint()
The unique identifier of the output.
-
set_outpoint
public void set_outpoint(OutPoint val)
The unique identifier of the output.
-
get_output
public TxOut get_output()
The output to spend.
-
set_output
public void set_output(TxOut val)
The output to spend.
-
get_satisfaction_weight
public long get_satisfaction_weight()
The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each with their lengths included, required to satisfy the output's script. The weight consumed by the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
-
set_satisfaction_weight
public void set_satisfaction_weight(long val)
The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each with their lengths included, required to satisfy the output's script. The weight consumed by the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
-
of
public static Utxo of(OutPoint outpoint_arg, TxOut output_arg, long satisfaction_weight_arg)
Constructs a new Utxo given each field
-
hash
public long hash()
Generates a non-cryptographic 64-bit hash of the Utxo.
-
eq
public boolean eq(Utxo b)
Checks if two Utxos contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
-
-