Skip to content

Add generic metadata field to TxNode #2068

@luisschwab

Description

@luisschwab

In order to integrate different metaprotocols with BDK, such as Utreexo and Silent Payments, an additional metadata field is needed in bdk_chain, under TxNode. e.g.:

/// A transaction node in the [`TxGraph`].
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub struct TxNode<'a, T, A, M> {
    /// Txid of the transaction.
    pub txid: Txid,
    /// A partial or full representation of the transaction.
    pub tx: T,
    /// The blocks that the transaction is "anchored" in.
    pub anchors: &'a BTreeSet<A>,
    /// The first-seen unix timestamp of the transaction as unconfirmed.
    pub first_seen: Option<u64>,
    /// The last-seen unix timestamp of the transaction as unconfirmed.
    pub last_seen: Option<u64>,
    /// The last-evicted-from-mempool unix timestamp of the transaction.
    pub last_evicted: Option<u64>,
    /// Transaction Metadata
    pub metadata: Option<M>,
}

Metadata

Metadata

Assignees

Projects

Status

Discussion

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions