remove unused Engine::is_proposal (#10475)
This commit is contained in:
parent
c9db8ea21d
commit
f875175325
@ -298,19 +298,11 @@ impl Importer {
|
|||||||
|
|
||||||
match self.check_and_lock_block(&bytes, block, client) {
|
match self.check_and_lock_block(&bytes, block, client) {
|
||||||
Ok((closed_block, pending)) => {
|
Ok((closed_block, pending)) => {
|
||||||
if self.engine.is_proposal(&header) {
|
imported_blocks.push(hash);
|
||||||
self.block_queue.mark_as_good(&[hash]);
|
let transactions_len = closed_block.transactions().len();
|
||||||
proposed_blocks.push(bytes);
|
let route = self.commit_block(closed_block, &header, encoded::Block::new(bytes), pending, client);
|
||||||
} else {
|
import_results.push(route);
|
||||||
imported_blocks.push(hash);
|
client.report.write().accrue_block(&header, transactions_len);
|
||||||
|
|
||||||
let transactions_len = closed_block.transactions().len();
|
|
||||||
|
|
||||||
let route = self.commit_block(closed_block, &header, encoded::Block::new(bytes), pending, client);
|
|
||||||
import_results.push(route);
|
|
||||||
|
|
||||||
client.report.write().accrue_block(&header, transactions_len);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
self.bad_blocks.report(bytes, format!("{:?}", err));
|
self.bad_blocks.report(bytes, format!("{:?}", err));
|
||||||
|
@ -375,10 +375,6 @@ pub trait Engine<M: Machine>: Sync + Send {
|
|||||||
/// updating consensus state and potentially issuing a new one.
|
/// updating consensus state and potentially issuing a new one.
|
||||||
fn handle_message(&self, _message: &[u8]) -> Result<(), EngineError> { Err(EngineError::UnexpectedMessage) }
|
fn handle_message(&self, _message: &[u8]) -> Result<(), EngineError> { Err(EngineError::UnexpectedMessage) }
|
||||||
|
|
||||||
/// Find out if the block is a proposal block and should not be inserted into the DB.
|
|
||||||
/// Takes a header of a fully verified block.
|
|
||||||
fn is_proposal(&self, _verified_header: &Header) -> bool { false }
|
|
||||||
|
|
||||||
/// Register a component which signs consensus messages.
|
/// Register a component which signs consensus messages.
|
||||||
fn set_signer(&self, _signer: Box<EngineSigner>) {}
|
fn set_signer(&self, _signer: Box<EngineSigner>) {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user