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>,
pub last_evicted: BTreeMap<Txid, u64>,
pub first_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.
last_evicted: BTreeMap<Txid, u64>Added timestamps of when a transaction is last evicted from the mempool.
first_seen: BTreeMap<Txid, u64>Added first-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§
impl<A> StructuralPartialEq for ChangeSet<A>
Auto Trait Implementations§
impl<A> Freeze for ChangeSet<A>
impl<A> RefUnwindSafe for ChangeSet<A>where
A: RefUnwindSafe,
impl<A> Send for ChangeSet<A>where
A: Send,
impl<A> Sync for ChangeSet<A>where
A: Sync,
impl<A> Unpin for ChangeSet<A>
impl<A> UnsafeUnpin for ChangeSet<A>
impl<A> UnwindSafe for ChangeSet<A>where
A: RefUnwindSafe,
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