mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +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.
|
// Close implements consensus.Engine. It's a noop for bor as there are no background threads.
|
||||||
func (c *Bor) Close() error {
|
func (c *Bor) Close() error {
|
||||||
c.closeOnce.Do(func() {
|
c.closeOnce.Do(func() {
|
||||||
|
if c.HeimdallClient != nil {
|
||||||
c.HeimdallClient.Close()
|
c.HeimdallClient.Close()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return nil
|
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)
|
genesisContractsClient := contract.NewGenesisContractsClient(chainConfig, chainConfig.Bor.ValidatorContract, chainConfig.Bor.StateReceiverContract, blockchainAPI)
|
||||||
spanner := span.NewChainSpanner(blockchainAPI, contract.ValidatorSet(), chainConfig, common.HexToAddress(chainConfig.Bor.ValidatorContract))
|
spanner := span.NewChainSpanner(blockchainAPI, contract.ValidatorSet(), chainConfig, common.HexToAddress(chainConfig.Bor.ValidatorContract))
|
||||||
|
|
||||||
|
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)
|
return bor.New(chainConfig, db, blockchainAPI, spanner, heimdall.NewHeimdallClient(ethConfig.HeimdallURL), genesisContractsClient)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
switch config.PowMode {
|
switch config.PowMode {
|
||||||
case ethash.ModeFake:
|
case ethash.ModeFake:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue