pub struct CompactLeafData {
pub header_code: u32,
pub amount: u64,
pub spk_ty: ScriptPubKeyKind,
}Expand description
Commitment of the leaf data, but in a compact way
The serialized format is:
[<header_code><amount><spk_type>]
The serialized header code format is: bit 0 - containing transaction is a coinbase bits 1-x - height of the block that contains the spent txout
It’s calculated with: header_code = <<= 1 if IsCoinBase { header_code |= 1 // only set the bit 0 if it’s a coinbase. } ScriptPubKeyKind is the output’s scriptPubKey, but serialized in a more efficient way to save bandwidth. If the type is recoverable from the scriptSig, don’t download the scriptPubKey.
Fields§
§header_code: u32Header code tells the height of creating for this UTXO and whether it’s a coinbase
amount: u64The amount locked in this UTXO
spk_ty: ScriptPubKeyKindThe type of the locking script for this UTXO
Trait Implementations§
Source§impl Clone for CompactLeafData
impl Clone for CompactLeafData
Source§fn clone(&self) -> CompactLeafData
fn clone(&self) -> CompactLeafData
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompactLeafData
impl Debug for CompactLeafData
Source§impl PartialEq for CompactLeafData
impl PartialEq for CompactLeafData
impl Eq for CompactLeafData
impl StructuralPartialEq for CompactLeafData
Auto Trait Implementations§
impl Freeze for CompactLeafData
impl RefUnwindSafe for CompactLeafData
impl Send for CompactLeafData
impl Sync for CompactLeafData
impl Unpin for CompactLeafData
impl UnwindSafe for CompactLeafData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more