Class Utxo


  • public class Utxo
    extends Object
    An unspent transaction output that is available to spend resulting from a successful [`CoinSelection`] attempt.
    • Method Detail

      • 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
      • clone

        public Utxo clone()
        Creates a copy of the Utxo
        Overrides:
        clone in class Object
      • hash

        public long hash()
        Generates a non-cryptographic 64-bit hash of the Utxo.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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.
      • new_p2pkh

        public static Utxo new_p2pkh​(OutPoint outpoint,
                                     long value,
                                     byte[] pubkey_hash)
        Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.