Struct ethcore_light::on_demand::OnDemand [] [src]

pub struct OnDemand { /* fields omitted */ }

On demand request service. See module docs for more details. Accumulates info about all peers' capabilities and dispatches requests to them accordingly.

Methods

impl OnDemand
[src]

Request a header by block number and CHT root hash.

Request a header by hash. This is less accurate than by-number because we don't know where in the chain this header lies, and therefore can't find a peer who is supposed to have it as easily.

Request a block, given its header. Block bodies are requestable by hash only, and the header is required anyway to verify and complete the block body -- this just doesn't obscure the network query.

Request the receipts for a block. The header serves two purposes: provide the block hash to fetch receipts for, and for verification of the receipts root.

Request an account by address and block header -- which gives a hash to query and a state root to verify against.

Trait Implementations

impl Default for OnDemand
[src]

Returns the "default value" for a type. Read more

impl Handler for OnDemand
[src]

Called when a peer connects.

Called when a peer disconnects, with a list of unfulfilled request IDs as of yet. Read more

Called when a peer makes an announcement.

Called when a peer responds with header proofs. Each proof should be a block header coupled with a series of trie nodes is ascending order by distance from the root. Read more

Called when a peer responds with block headers.

Called when a peer responds with block bodies.

Called when a peer responds with block receipts.

Called when a peer responds with state proofs. Each proof should be a series of trie nodes in ascending order by distance from the root. Read more

Called when a peer requests relay of some transactions.

Called when a peer responds with contract code.

Called to "tick" the handler periodically.

Called on abort. This signals to handlers that they should clean up and ignore peers. Read more