pub struct Relayer { /* private fields */ }Expand description
Relayer protocol handle
Implementations
Init relay protocol handle
This is a runtime relay protocol shared state, and any relay messages will be processed and forwarded by it
Get shared state
pub fn request_proposal_txs(
&self,
nc: &dyn CKBProtocolContext,
peer: PeerIndex,
block_hash_and_number: BlockNumberAndHash,
proposals: Vec<ProposalShortId>
)
pub fn request_proposal_txs(
&self,
nc: &dyn CKBProtocolContext,
peer: PeerIndex,
block_hash_and_number: BlockNumberAndHash,
proposals: Vec<ProposalShortId>
)
Request the transaction corresponding to the proposal id from the specified node
Accept a new block from network
pub fn reconstruct_block(
&self,
active_chain: &ActiveChain,
compact_block: &CompactBlock,
received_transactions: Vec<TransactionView>,
uncles_index: &[u32],
received_uncles: &[UncleBlockView]
) -> ReconstructionResult
pub fn reconstruct_block(
&self,
active_chain: &ActiveChain,
compact_block: &CompactBlock,
received_transactions: Vec<TransactionView>,
uncles_index: &[u32],
received_uncles: &[UncleBlockView]
) -> ReconstructionResult
Reorganize the full block according to the compact block/txs/uncles
Ask for relay transaction by hash from all peers
Send bulk of tx hashes to selected peers
Trait Implementations
Init action on service run
Called when the corresponding protocol message is received
Called when opening protocol
Called when closing protocol
Called when the Service receives the notify task
Auto Trait Implementations
impl !RefUnwindSafe for Relayer
impl !UnwindSafe for Relayer
Blanket Implementations
Mutably borrows from an owned value. Read more