Bad blocks RPC + reporting (#9433)
* Bad blocks RPC. * Return bad blocks via RPC. * Fix test. * More verbose bad block message. * Expose via CLI. * Remove stray whitespace. * Remove stray newline. * Fix tests.
This commit is contained in:
committed by
Afri Schoedon
parent
915c366056
commit
61bd47ccc1
@@ -211,9 +211,15 @@ pub trait IoClient: Sync + Send {
|
||||
fn queue_consensus_message(&self, message: Bytes);
|
||||
}
|
||||
|
||||
/// Provides recently seen bad blocks.
|
||||
pub trait BadBlocks {
|
||||
/// Returns a list of blocks that were recently not imported because they were invalid.
|
||||
fn bad_blocks(&self) -> Vec<(Unverified, String)>;
|
||||
}
|
||||
|
||||
/// Blockchain database client. Owns and manages a blockchain and a block queue.
|
||||
pub trait BlockChainClient : Sync + Send + AccountData + BlockChain + CallContract + RegistryInfo + ImportBlock
|
||||
+ IoClient {
|
||||
+ IoClient + BadBlocks {
|
||||
/// Look up the block number for the given block ID.
|
||||
fn block_number(&self, id: BlockId) -> Option<BlockNumber>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user