[−][src]Struct grin_servers::common::adapters::NetToChainAdapter
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
) -> NetToChainAdapter
[src]
sync_state: Arc<SyncState>,
chain: Arc<Chain>,
tx_pool: Arc<RwLock<TransactionPool>>,
verifier_cache: Arc<RwLock<dyn VerifierCache>>,
config: ServerConfig
) -> NetToChainAdapter
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 total_difficulty(&self) -> Difficulty
[src]
fn total_height(&self) -> u64
[src]
fn get_transaction(&self, kernel_hash: Hash) -> Option<Transaction>
[src]
fn tx_kernel_received(&self, kernel_hash: Hash, addr: PeerAddr)
[src]
fn transaction_received(&self, tx: Transaction, stem: bool)
[src]
fn block_received(&self, b: Block, addr: PeerAddr, was_requested: bool) -> bool
[src]
fn compact_block_received(&self, cb: CompactBlock, addr: PeerAddr) -> bool
[src]
fn header_received(&self, bh: BlockHeader, addr: PeerAddr) -> bool
[src]
fn headers_received(&self, bhs: &[BlockHeader], addr: PeerAddr) -> bool
[src]
fn locate_headers(&self, locator: &[Hash]) -> Vec<BlockHeader>
[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_receive_ready(&self) -> bool
[src]
fn txhashset_download_update(
&self,
start_time: DateTime<Utc>,
downloaded_size: u64,
total_size: u64
) -> bool
[src]
&self,
start_time: DateTime<Utc>,
downloaded_size: u64,
total_size: u64
) -> bool
fn txhashset_write(
&self,
h: Hash,
txhashset_data: File,
_peer_addr: PeerAddr
) -> bool
[src]
&self,
h: Hash,
txhashset_data: File,
_peer_addr: PeerAddr
) -> bool
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
impl Send for NetToChainAdapter
impl Sync for NetToChainAdapter
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Erased for T
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<T> SafeBorrow for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<T> Same for T
type Output = T
Should always be Self