mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Set Heimdall client to nil when 'withoutheimdall' is set
This commit is contained in:
parent
9bc9a45758
commit
9ec673870a
2 changed files with 8 additions and 2 deletions
|
|
@ -960,7 +960,9 @@ func (c *Bor) APIs(chain consensus.ChainHeaderReader) []rpc.API {
|
|||
// Close implements consensus.Engine. It's a noop for bor as there are no background threads.
|
||||
func (c *Bor) Close() error {
|
||||
c.closeOnce.Do(func() {
|
||||
c.HeimdallClient.Close()
|
||||
if c.HeimdallClient != nil {
|
||||
c.HeimdallClient.Close()
|
||||
}
|
||||
})
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -243,7 +243,11 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, et
|
|||
genesisContractsClient := contract.NewGenesisContractsClient(chainConfig, chainConfig.Bor.ValidatorContract, chainConfig.Bor.StateReceiverContract, blockchainAPI)
|
||||
spanner := span.NewChainSpanner(blockchainAPI, contract.ValidatorSet(), chainConfig, common.HexToAddress(chainConfig.Bor.ValidatorContract))
|
||||
|
||||
return bor.New(chainConfig, db, blockchainAPI, spanner, heimdall.NewHeimdallClient(ethConfig.HeimdallURL), genesisContractsClient)
|
||||
if ethConfig.WithoutHeimdall {
|
||||
return bor.New(chainConfig, db, blockchainAPI, spanner, nil, genesisContractsClient)
|
||||
} else {
|
||||
return bor.New(chainConfig, db, blockchainAPI, spanner, heimdall.NewHeimdallClient(ethConfig.HeimdallURL), genesisContractsClient)
|
||||
}
|
||||
} else {
|
||||
switch config.PowMode {
|
||||
case ethash.ModeFake:
|
||||
|
|
|
|||
Loading…
Reference in a new issue