Struct ckb_sync::Relayer [−][src]
pub struct Relayer { /* fields omitted */ }Expand description
Relayer protocol handle
Implementations
pub fn new(
chain: ChainController,
shared: Arc<SyncShared>,
min_fee_rate: FeeRate,
max_tx_verify_cycles: Cycle
) -> Self
pub fn new(
chain: ChainController,
shared: Arc<SyncShared>,
min_fee_rate: FeeRate,
max_tx_verify_cycles: Cycle
) -> Self
Init relay protocol handle
This is a runtime relay protocol shared state, and any relay messages will be processed and forwarded by it
min_fee_rate: Default transaction fee unit, can be modified by configuration file max_tx_verify_cycles: Maximum transaction consumption allowed by default, can be modified by configuration file
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