[][src]Struct grin_wallet_libwallet::OutputData

pub struct OutputData {
    pub root_key_id: Identifier,
    pub key_id: Identifier,
    pub n_child: u32,
    pub commit: Option<String>,
    pub mmr_index: Option<u64>,
    pub value: u64,
    pub status: OutputStatus,
    pub height: u64,
    pub lock_height: u64,
    pub is_coinbase: bool,
    pub tx_log_entry: Option<u32>,
}

Information about an output that's being tracked by the wallet. Must be enough to reconstruct the commitment associated with the ouput when the root private key is known.

Fields

root_key_id: Identifier

Root key_id that the key for this output is derived from

key_id: Identifier

Derived key for this output

n_child: u32

How many derivations down from the root key

commit: Option<String>

The actual commit, optionally stored

mmr_index: Option<u64>

PMMR Index, used on restore in case of duplicate wallets using the same key_id (2 wallets using same seed, for instance

value: u64

Value of the output, necessary to rebuild the commitment

status: OutputStatus

Current status of the output

height: u64

Height of the output

lock_height: u64

Height we are locked until

is_coinbase: bool

Is this a coinbase output? Is it subject to coinbase locktime?

tx_log_entry: Option<u32>

Optional corresponding internal entry in tx entry log

Methods

impl OutputData[src]

pub fn lock(&mut self)[src]

Lock a given output to avoid conflicting use

pub fn num_confirmations(&self, current_height: u64) -> u64[src]

How many confirmations has this output received? If height == 0 then we are either Unconfirmed or the output was cut-through so we do not actually know how many confirmations this output had (and never will).

pub fn eligible_to_spend(
    &self,
    current_height: u64,
    minimum_confirmations: u64
) -> bool
[src]

Check if output is eligible to spend based on state and height and confirmations

pub fn mark_unspent(&mut self)[src]

Marks this output as unspent if it was previously unconfirmed

pub fn mark_spent(&mut self)[src]

Mark an output as spent

Trait Implementations

impl Clone for OutputData[src]

impl Eq for OutputData[src]

impl Ord for OutputData[src]

impl PartialEq<OutputData> for OutputData[src]

impl PartialOrd<OutputData> for OutputData[src]

impl Debug for OutputData[src]

impl Serialize for OutputData[src]

impl<'de> Deserialize<'de> for OutputData[src]

impl Writeable for OutputData[src]

impl Readable for OutputData[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Send + Sync + Clone

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,