mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
commit
dfb2c64bd3
3 changed files with 9 additions and 9 deletions
|
|
@ -290,7 +290,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
started := false
|
started := false
|
||||||
ok, err := ethereum.ValidateMiner()
|
ok, err := ethereum.ValidateStaker()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Fatalf("Can't verify validator permission: %v", err)
|
utils.Fatalf("Can't verify validator permission: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -307,8 +307,8 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
}
|
}
|
||||||
// Set the gas price to the limits from the CLI and start mining
|
// Set the gas price to the limits from the CLI and start mining
|
||||||
ethereum.TxPool().SetGasPrice(utils.GlobalBig(ctx, utils.GasPriceFlag.Name))
|
ethereum.TxPool().SetGasPrice(utils.GlobalBig(ctx, utils.GasPriceFlag.Name))
|
||||||
if err := ethereum.StartMining(true); err != nil {
|
if err := ethereum.StartStaking(true); err != nil {
|
||||||
utils.Fatalf("Failed to start mining: %v", err)
|
utils.Fatalf("Failed to start staking: %v", err)
|
||||||
}
|
}
|
||||||
started = true
|
started = true
|
||||||
log.Info("Enabled mining node!!!")
|
log.Info("Enabled mining node!!!")
|
||||||
|
|
@ -317,7 +317,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
|
|
||||||
for range core.Checkpoint {
|
for range core.Checkpoint {
|
||||||
log.Info("Checkpoint!!! It's time to reconcile node's state...")
|
log.Info("Checkpoint!!! It's time to reconcile node's state...")
|
||||||
ok, err := ethereum.ValidateMiner()
|
ok, err := ethereum.ValidateStaker()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Fatalf("Can't verify validator permission: %v", err)
|
utils.Fatalf("Can't verify validator permission: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -341,7 +341,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
}
|
}
|
||||||
// Set the gas price to the limits from the CLI and start mining
|
// Set the gas price to the limits from the CLI and start mining
|
||||||
ethereum.TxPool().SetGasPrice(utils.GlobalBig(ctx, utils.GasPriceFlag.Name))
|
ethereum.TxPool().SetGasPrice(utils.GlobalBig(ctx, utils.GasPriceFlag.Name))
|
||||||
if err := ethereum.StartMining(true); err != nil {
|
if err := ethereum.StartStaking(true); err != nil {
|
||||||
utils.Fatalf("Failed to start mining: %v", err)
|
utils.Fatalf("Failed to start mining: %v", err)
|
||||||
}
|
}
|
||||||
started = true
|
started = true
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ func (api *PublicMinerAPI) SubmitWork(nonce types.BlockNonce, solution, digest c
|
||||||
// result[2], 32 bytes hex encoded boundary condition ("target"), 2^256/difficulty
|
// result[2], 32 bytes hex encoded boundary condition ("target"), 2^256/difficulty
|
||||||
func (api *PublicMinerAPI) GetWork() ([3]string, error) {
|
func (api *PublicMinerAPI) GetWork() ([3]string, error) {
|
||||||
if !api.e.IsMining() {
|
if !api.e.IsMining() {
|
||||||
if err := api.e.StartMining(false); err != nil {
|
if err := api.e.StartStaking(false); err != nil {
|
||||||
return [3]string{}, err
|
return [3]string{}, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ func (api *PrivateMinerAPI) Start(threads *int) error {
|
||||||
api.e.lock.RUnlock()
|
api.e.lock.RUnlock()
|
||||||
|
|
||||||
api.e.txPool.SetGasPrice(price)
|
api.e.txPool.SetGasPrice(price)
|
||||||
return api.e.StartMining(true)
|
return api.e.StartStaking(true)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ func (self *Ethereum) SetEtherbase(etherbase common.Address) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateMiner checks if node's address is in set of validators
|
// ValidateMiner checks if node's address is in set of validators
|
||||||
func (s *Ethereum) ValidateMiner() (bool, error) {
|
func (s *Ethereum) ValidateStaker() (bool, error) {
|
||||||
eb, err := s.Etherbase()
|
eb, err := s.Etherbase()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
|
@ -468,7 +468,7 @@ func (s *Ethereum) ValidateMiner() (bool, error) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Ethereum) StartMining(local bool) error {
|
func (s *Ethereum) StartStaking(local bool) error {
|
||||||
eb, err := s.Etherbase()
|
eb, err := s.Etherbase()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Cannot start mining without etherbase", "err", err)
|
log.Error("Cannot start mining without etherbase", "err", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue