pub struct ChangeSet<A = ()> {
pub txs: BTreeSet<Arc<Transaction>>,
pub txouts: BTreeMap<OutPoint, TxOut>,
pub anchors: BTreeSet<(A, Txid)>,
pub last_seen: BTreeMap<Txid, u64>,
}
Expand description
The ChangeSet
represents changes to a TxGraph
.
Since TxGraph
is monotone, the “changeset” can only contain transactions to be added and
not removed.
Refer to module-level documentation for more.
Fields§
§txs: BTreeSet<Arc<Transaction>>
Added transactions.
txouts: BTreeMap<OutPoint, TxOut>
Added txouts.
anchors: BTreeSet<(A, Txid)>
Added anchors.
last_seen: BTreeMap<Txid, u64>
Added last-seen unix timestamps of transactions.
Implementations§
source§impl<A> ChangeSet<A>
impl<A> ChangeSet<A>
sourcepub fn txouts(&self) -> impl Iterator<Item = (OutPoint, &TxOut)>
pub fn txouts(&self) -> impl Iterator<Item = (OutPoint, &TxOut)>
Iterates over all outpoints contained within ChangeSet
.
sourcepub fn anchor_heights(&self) -> impl Iterator<Item = u32> + '_where
A: Anchor,
pub fn anchor_heights(&self) -> impl Iterator<Item = u32> + '_where
A: Anchor,
Iterates over the heights of that the new transaction anchors in this changeset.
This is useful if you want to find which heights you need to fetch data about in order to confirm or exclude these anchors.
Trait Implementations§
source§impl<'de, A> Deserialize<'de> for ChangeSet<A>where
A: Ord + Deserialize<'de>,
impl<'de, A> Deserialize<'de> for ChangeSet<A>where
A: Ord + Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more