pub enum ChainEvent {
    BlockConnected {
        height: u64,
        header: BlockHeader,
    },
    BlockDisconnected {
        height: u64,
        header: BlockHeader,
    },
    BlockDiscovered(SocketAddr, BlockHash),
    Syncing {
        current: u64,
        best: u64,
    },
    Synced(BlockHash, u64),
    StaleTip(LocalTime),
    PeerMisbehaved(SocketAddr),
    PeerHeightUpdated {
        height: u64,
    },
}
Expand description

An event emitted by the sync manager.

Variants

BlockConnected

Fields

height: u64

Block height.

header: BlockHeader

Block header.

A block was added to the main chain.

BlockDisconnected

Fields

height: u64

Block height.

header: BlockHeader

Block header.

A block was removed from the main chain.

BlockDiscovered(SocketAddr, BlockHash)

A new block was discovered via a peer.

Syncing

Fields

current: u64

Current block header height.

best: u64

Best known block header height.

Syncing headers.

Synced(BlockHash, u64)

Synced up to the specified hash and height.

StaleTip(LocalTime)

Potential stale tip detected on the active chain.

PeerMisbehaved(SocketAddr)

Peer misbehaved.

PeerHeightUpdated

Fields

height: u64

Best height known.

Peer height updated.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.