[−][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,
hooks: Vec<Box<dyn NetEvents + Send + Sync>>
) -> NetToChainAdapter
[src]
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
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) -> Result<Difficulty, Error>
[src]
fn total_height(&self) -> Result<u64, Error>
[src]
fn get_transaction(&self, kernel_hash: Hash) -> Option<Transaction>
[src]
fn tx_kernel_received(
&self,
kernel_hash: Hash,
peer_info: &PeerInfo
) -> Result<bool, Error>
[src]
&self,
kernel_hash: Hash,
peer_info: &PeerInfo
) -> Result<bool, Error>
fn transaction_received(
&self,
tx: Transaction,
stem: bool
) -> Result<bool, Error>
[src]
&self,
tx: Transaction,
stem: bool
) -> Result<bool, Error>
fn block_received(
&self,
b: Block,
peer_info: &PeerInfo,
was_requested: bool
) -> Result<bool, Error>
[src]
&self,
b: Block,
peer_info: &PeerInfo,
was_requested: bool
) -> Result<bool, Error>
fn compact_block_received(
&self,
cb: CompactBlock,
peer_info: &PeerInfo
) -> Result<bool, Error>
[src]
&self,
cb: CompactBlock,
peer_info: &PeerInfo
) -> Result<bool, Error>
fn header_received(
&self,
bh: BlockHeader,
peer_info: &PeerInfo
) -> Result<bool, Error>
[src]
&self,
bh: BlockHeader,
peer_info: &PeerInfo
) -> Result<bool, Error>
fn headers_received(
&self,
bhs: &[BlockHeader],
peer_info: &PeerInfo
) -> Result<bool, Error>
[src]
&self,
bhs: &[BlockHeader],
peer_info: &PeerInfo
) -> Result<bool, Error>
fn locate_headers(&self, locator: &[Hash]) -> Result<Vec<BlockHeader>, Error>
[src]
fn get_block(&self, h: Hash) -> Option<Block>
[src]
Gets a full block by its hash.
fn kernel_data_read(&self) -> Result<File, Error>
[src]
fn kernel_data_write(&self, reader: &mut dyn Read) -> Result<bool, Error>
[src]
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_info: &PeerInfo
) -> Result<bool, Error>
[src]
&self,
h: Hash,
txhashset_data: File,
_peer_info: &PeerInfo
) -> Result<bool, Error>
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.
fn get_tmp_dir(&self) -> PathBuf
[src]
fn get_tmpfile_pathname(&self, tmpfile_name: String) -> PathBuf
[src]
Auto Trait Implementations
impl Send for NetToChainAdapter
impl Unpin for NetToChainAdapter
impl Sync for NetToChainAdapter
impl !UnwindSafe for NetToChainAdapter
impl !RefUnwindSafe for NetToChainAdapter
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<T> UnsafeAny for T where
T: Any,
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>,
V: MultiLane<T>,