diff --git a/consensus/aura/aura.go b/consensus/aura/aura.go index 876fd7279343..0d41e2e514c1 100644 --- a/consensus/aura/aura.go +++ b/consensus/aura/aura.go @@ -206,7 +206,7 @@ type Aura struct { lock sync.RWMutex // Protects the signer fields } -// New creates a Clique proof-of-authority consensus engine with the initial +// New creates a Aura proof-of-authority consensus engine with the initial // signers set to the ones provided by the user. func New(config *params.AuraConfig, db ethdb.Database) *Aura { // Set any missing consensus parameters to their defaults diff --git a/eth/backend.go b/eth/backend.go index 9926225f247c..019fceb61193 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -49,6 +49,7 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/consensus/aura" ) type LesServer interface { @@ -220,6 +221,8 @@ func CreateConsensusEngine(ctx *node.ServiceContext, chainConfig *params.ChainCo // If proof-of-authority is requested, set it up if chainConfig.Clique != nil { return clique.New(chainConfig.Clique, db) + } else if chainConfig.Aura != nil { + return aura.New(chainConfig.Aura, db) } // Otherwise assume proof-of-work switch config.PowMode { @@ -375,6 +378,15 @@ func (s *Ethereum) StartMining(threads int) error { return fmt.Errorf("signer missing: %v", err) } clique.Authorize(eb, wallet.SignHash) + } else { + if aura, ok := s.engine.(*aura.Aura); ok { + wallet, e := s.accountManager.Find(accounts.Account{Address: eb}) + if wallet == nil || e != nil { + log.Error("Etherbase account unavailable locally", "err", err) + return fmt.Errorf("signer missing: %v", err) + } + aura.Authorize(eb, wallet.SignHash) + } } // If mining is started, we can disable the transaction rejection mechanism // introduced to speed sync times.