aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-09-03 13:42:13 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 17:20:14 +0800
commit1c5de76404aebd2f82d337f7ef5633bce2de586f (patch)
tree2177b345598c513214efe6b3efac764d208f2cfe /eth
parent24d727b6d6e2c0cde222fa12155c4a6db5caaf2e (diff)
downloaddexon-1c5de76404aebd2f82d337f7ef5633bce2de586f.tar.gz
dexon-1c5de76404aebd2f82d337f7ef5633bce2de586f.tar.zst
dexon-1c5de76404aebd2f82d337f7ef5633bce2de586f.zip
Add initial DEXON consensus engine implementation skeleton
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 354fc17d4..bf474f2e4 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -30,6 +30,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/clique"
+ "github.com/ethereum/go-ethereum/consensus/dexcon"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
@@ -222,6 +223,10 @@ func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Data
// CreateConsensusEngine creates the required type of consensus engine instance for an Ethereum service
func CreateConsensusEngine(ctx *node.ServiceContext, chainConfig *params.ChainConfig, config *ethash.Config, notify []string, noverify bool, db ethdb.Database) consensus.Engine {
// If proof-of-authority is requested, set it up
+ if chainConfig.Dexcon != nil {
+ return dexcon.New(chainConfig.Dexcon)
+ }
+ // If proof-of-authority is requested, set it up
if chainConfig.Clique != nil {
return clique.New(chainConfig.Clique, db)
}