mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
Fixed bug too many open IPC connect at same time.
This commit is contained in:
parent
725930f310
commit
3584bcfa5f
1 changed files with 9 additions and 9 deletions
|
|
@ -205,15 +205,15 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
|||
endBlockNumber := startBlockNumber + rCheckpoint - 1
|
||||
signers := make(map[common.Address]*rewardLog)
|
||||
totalSigner := uint64(0)
|
||||
// Get signers in blockSigner smartcontract.
|
||||
client, err := contracts.GetEthClient(ctx)
|
||||
if err != nil {
|
||||
log.Error("Fail to connect IPC from blockSigner", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
for i := startBlockNumber; i <= endBlockNumber; i++ {
|
||||
// Get signers in blockSigner smartcontract.
|
||||
client, err := contracts.GetEthClient(ctx)
|
||||
if err != nil {
|
||||
log.Error("Fail to connect IPC from blockSigner", "error", err)
|
||||
return err
|
||||
}
|
||||
addrs, err := contracts.GetSignersFromContract(client, i
|
||||
addrs, err := contracts.GetSignersFromContract(client, i)
|
||||
if err != nil {
|
||||
log.Error("Fail to get signers from smartcontract.", "error", err, "blockNumber", i)
|
||||
return err
|
||||
|
|
@ -420,7 +420,7 @@ func (self *Ethereum) SetEtherbase(etherbase common.Address) {
|
|||
}
|
||||
|
||||
// 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()
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
|
@ -442,7 +442,7 @@ func (s *Ethereum) ValidateMiner() (bool, error) {
|
|||
return true, nil
|
||||
}
|
||||
|
||||
func (s *Ethereum) StartMining(local bool) error {
|
||||
func (s *Ethereum) StartStaking(local bool) error {
|
||||
eb, err := s.Etherbase()
|
||||
if err != nil {
|
||||
log.Error("Cannot start mining without etherbase", "err", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue