[][src]Struct grin_servers::common::adapters::NetToChainAdapter

pub struct NetToChainAdapter { /* fields omitted */ }

Implementation of the NetAdapter for the . Gets notified when new blocks and transactions are received and forwards to the chain and pool implementations.

Methods

impl NetToChainAdapter[src]

pub fn new(
    sync_state: Arc<SyncState>,
    chain: Arc<Chain>,
    tx_pool: Arc<RwLock<TransactionPool>>,
    verifier_cache: Arc<RwLock<dyn VerifierCache>>,
    config: ServerConfig,
    hooks: Vec<Box<dyn NetEvents + Send + Sync>>
) -> NetToChainAdapter
[src]

Construct a new NetToChainAdapter instance

pub fn init(&self, peers: Arc<Peers>)[src]

Initialize a NetToChainAdaptor with reference to a Peers object. Should only be called once.

Trait Implementations

impl ChainAdapter for NetToChainAdapter[src]

fn get_block(&self, h: Hash) -> Option<Block>[src]

Gets a full block by its hash.

fn txhashset_read(&self, h: Hash) -> Option<TxHashSetRead>[src]

Provides a reading view into the current txhashset state as well as the required indexes for a consumer to rewind to a consistent state at the provided block hash.

fn txhashset_write(
    &self,
    h: Hash,
    txhashset_data: File,
    _peer_info: &PeerInfo
) -> Result<bool, Error>
[src]

Writes a reading view on a txhashset state that's been provided to us. If we're willing to accept that new state, the data stream will be read as a zip file, unzipped and the resulting state files should be rewound to the provided indexes.

Auto Trait Implementations

Blanket Implementations

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

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

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

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

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self

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