mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
Fixed randomize for mi and m2
This commit is contained in:
parent
4af57cc070
commit
2fa93cdbf2
1 changed files with 15 additions and 16 deletions
|
|
@ -27,6 +27,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
|
|
@ -34,6 +35,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||
"github.com/ethereum/go-ethereum/consensus/XDPoS"
|
||||
"github.com/ethereum/go-ethereum/contracts"
|
||||
contractValidator "github.com/ethereum/go-ethereum/contracts/validator/contract"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
|
|
@ -45,8 +47,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/syndtr/goleveldb/leveldb"
|
||||
"github.com/syndtr/goleveldb/leveldb/util"
|
||||
contractValidator "github.com/ethereum/go-ethereum/contracts/validator/contract"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -700,7 +700,6 @@ func (s *PublicBlockChainAPI) GetMasternodes(ctx context.Context, b *types.Block
|
|||
return masternodes, nil
|
||||
}
|
||||
|
||||
|
||||
// GetCandidateStatus returns status of the given candidate at a specified epochNumber
|
||||
func (s *PublicBlockChainAPI) GetCandidateStatus(ctx context.Context, coinbaseAddress common.Address, epochNumber rpc.EpochNumber) (string, error) {
|
||||
var (
|
||||
|
|
@ -780,12 +779,12 @@ func (s *PublicBlockChainAPI) GetCandidateStatus(ctx context.Context, coinbaseAd
|
|||
break
|
||||
}
|
||||
}
|
||||
if isTopCandidate == false {
|
||||
if !isTopCandidate {
|
||||
return status, nil
|
||||
}
|
||||
// look up recent checkpoint headers to get penalty list
|
||||
for i := 0; i <= common.LimitPenaltyEpoch; i++ {
|
||||
if blockNum > uint64(i) * epoch {
|
||||
if blockNum > uint64(i)*epoch {
|
||||
blockCheckpointNumber := rpc.BlockNumber(blockNum - (blockNum % epoch) - (uint64(i) * epoch))
|
||||
blockCheckpoint, err := s.b.BlockByNumber(ctx, blockCheckpointNumber)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue