chg: set signer for bor

This commit is contained in:
Jaynti Kanani 2020-11-14 15:36:39 +05:30
parent 7fe2cd4384
commit 4c5f8153f1
No known key found for this signature in database
GPG key ID: 4396982C976BAE5E
3 changed files with 14 additions and 0 deletions

View file

@ -473,6 +473,14 @@ func (s *Ethereum) StartMining(threads int) error {
}
clique.Authorize(eb, wallet.SignData)
}
if bor, ok := s.engine.(*bor.Bor); ok {
wallet, err := s.accountManager.Find(accounts.Account{Address: eb})
if wallet == nil || err != nil {
log.Error("Etherbase account unavailable locally", "err", err)
return fmt.Errorf("signer missing: %v", err)
}
bor.Authorize(eb, wallet.SignData)
}
// If mining is started, we can disable the transaction rejection mechanism
// introduced to speed sync times.
atomic.StoreUint32(&s.protocolManager.acceptTxs, 1)

View file

@ -371,6 +371,8 @@ func (c *ChainConfig) String() string {
engine = c.Ethash
case c.Clique != nil:
engine = c.Clique
case c.Bor != nil:
engine = c.Bor
default:
engine = "unknown"
}

View file

@ -58,6 +58,10 @@ var (
accounts.MimetypeClique,
0x02,
}
ApplicationBor = SigFormat{
accounts.MimetypeBor,
0x10,
}
TextPlain = SigFormat{
accounts.MimetypeTextPlain,
0x45,