From 94ec62c544520084e6336c39a8fb6a4c5e7bdfbb Mon Sep 17 00:00:00 2001 From: "mark.lin" Date: Tue, 12 Sep 2017 10:55:02 +0800 Subject: [PATCH] consensus: add Istanbul consensus engine interface --- consensus/consensus.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/consensus/consensus.go b/consensus/consensus.go index 1e013d5d4c..87228ae49d 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -120,3 +120,14 @@ type PoW interface { // Hashrate returns the current mining hashrate of a PoW consensus engine. Hashrate() float64 } + +// Istanbul is a consensus engine to avoid byzantine failure +type Istanbul interface { + Engine + + // Start starts the engine + Start(chain ChainReader, currentBlock func() *types.Block, hasBadBlock func(hash common.Hash) bool) error + + // Stop stops the engine + Stop() error +}