pub struct Utxo {
pub outpoint: OutPoint,
pub output: TxOut,
pub satisfaction_weight: u64,
}Expand description
An unspent transaction output that is available to spend resulting from a successful
CoinSelection attempt.
Fields§
§outpoint: OutPointThe unique identifier of the output.
output: TxOutThe output to spend.
satisfaction_weight: u64The 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.
Implementations§
Source§impl Utxo
impl Utxo
Sourcepub fn new_p2pkh(
outpoint: OutPoint,
value: Amount,
pubkey_hash: &PubkeyHash,
) -> Self
pub fn new_p2pkh( outpoint: OutPoint, value: Amount, pubkey_hash: &PubkeyHash, ) -> Self
Returns a Utxo with the satisfaction_weight estimate for a legacy P2PKH output.
Sourcepub fn new_nested_p2wpkh(
outpoint: OutPoint,
value: Amount,
pubkey_hash: &WPubkeyHash,
) -> Self
pub fn new_nested_p2wpkh( outpoint: OutPoint, value: Amount, pubkey_hash: &WPubkeyHash, ) -> Self
Returns a Utxo with the satisfaction_weight estimate for a P2WPKH nested in P2SH output.
Sourcepub fn new_v0_p2wpkh(
outpoint: OutPoint,
value: Amount,
pubkey_hash: &WPubkeyHash,
) -> Self
pub fn new_v0_p2wpkh( outpoint: OutPoint, value: Amount, pubkey_hash: &WPubkeyHash, ) -> Self
Returns a Utxo with the satisfaction_weight estimate for a SegWit v0 P2WPKH output.
Trait Implementations§
Source§impl Ord for Utxo
impl Ord for Utxo
Source§impl PartialOrd for Utxo
impl PartialOrd for Utxo
impl Eq for Utxo
impl StructuralPartialEq for Utxo
Auto Trait Implementations§
impl Freeze for Utxo
impl RefUnwindSafe for Utxo
impl Send for Utxo
impl Sync for Utxo
impl Unpin for Utxo
impl UnwindSafe for Utxo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more