pub struct SyncRequest {
    pub chain_tip: CheckPoint,
    pub tx_cache: TxCache,
    pub spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>,
    pub txids: Box<dyn ExactSizeIterator<Item = Txid> + Send>,
    pub outpoints: Box<dyn ExactSizeIterator<Item = OutPoint> + Send>,
}
Expand description

Data required to perform a spk-based blockchain client sync.

A client sync fetches relevant chain data for a known list of scripts, transaction ids and outpoints. The sync process also updates the chain from the given CheckPoint.

Fields§

§chain_tip: CheckPoint

A checkpoint for the current chain LocalChain::tip. The sync process will return a new chain update that extends this tip.

§tx_cache: TxCache

Cache of full transactions, so the chain-source can avoid re-fetching.

§spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>

Transactions that spend from or to these indexed script pubkeys.

§txids: Box<dyn ExactSizeIterator<Item = Txid> + Send>

Transactions with these txids.

§outpoints: Box<dyn ExactSizeIterator<Item = OutPoint> + Send>

Transactions with these outpoints or spent from these outpoints.

Implementations§

Construct a new SyncRequest from a given cp tip.

Add to the TxCache held by the request.

This consumes the SyncRequest and returns the updated one.

Add all transactions from TxGraph into the TxCache.

This consumes the SyncRequest and returns the updated one.

Set the [Script]s that will be synced against.

This consumes the SyncRequest and returns the updated one.

Set the [Txid]s that will be synced against.

This consumes the SyncRequest and returns the updated one.

Set the [OutPoint]s that will be synced against.

This consumes the SyncRequest and returns the updated one.

Chain on additional [Script]s that will be synced against.

This consumes the SyncRequest and returns the updated one.

Chain on additional [Txid]s that will be synced against.

This consumes the SyncRequest and returns the updated one.

Chain on additional [OutPoint]s that will be synced against.

This consumes the SyncRequest and returns the updated one.

Add a closure that will be called for [Script]s previously added to this request.

This consumes the SyncRequest and returns the updated one.

Add a closure that will be called for [Txid]s previously added to this request.

This consumes the SyncRequest and returns the updated one.

Add a closure that will be called for [OutPoint]s previously added to this request.

This consumes the SyncRequest and returns the updated one.

Populate the request with revealed script pubkeys from index with the given spk_range.

This consumes the SyncRequest and returns the updated one.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.