Merge pull request #237 from gzliudan/fix-empty-address

fix empty address
This commit is contained in:
Anil Chinchawale 2023-06-16 14:23:44 +05:30 committed by GitHub
commit d2ce55ec96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -10,7 +10,7 @@ import (
)
var (
EmptyAddress = "0x0000000000000000000000000000000000000000"
EmptyAddress = "xdc0000000000000000000000000000000000000000"
EmptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
)

View file

@ -238,7 +238,7 @@ func AttachConsensusV1Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConf
if err != nil {
return nil, err
}
if address.String() != "0x0000000000000000000000000000000000000000" {
if address.String() != "xdc0000000000000000000000000000000000000000" {
candidates = append(candidates, utils.Masternode{Address: address, Stake: v})
}
}

View file

@ -754,7 +754,7 @@ func (s *PublicBlockChainAPI) GetCandidateStatus(ctx context.Context, coinbaseAd
candidatesAddresses := state.GetCandidates(statedb)
for _, address := range candidatesAddresses {
v := state.GetCandidateCap(statedb, address)
if address.String() != "0x0000000000000000000000000000000000000000" {
if address.String() != "xdc0000000000000000000000000000000000000000" {
candidates = append(candidates, utils.Masternode{Address: address, Stake: v})
}
}
@ -880,7 +880,7 @@ func (s *PublicBlockChainAPI) GetCandidates(ctx context.Context, epoch rpc.Epoch
candidatesAddresses := state.GetCandidates(statedb)
for _, address := range candidatesAddresses {
v := state.GetCandidateCap(statedb, address)
if address.String() != "0x0000000000000000000000000000000000000000" {
if address.String() != "xdc0000000000000000000000000000000000000000" {
candidates = append(candidates, utils.Masternode{Address: address, Stake: v})
}
}
@ -1009,7 +1009,7 @@ func (s *PublicBlockChainAPI) getCandidatesFromSmartContract() ([]utils.Masterno
if err != nil {
return []utils.Masternode{}, err
}
if candidate.String() != "0x0000000000000000000000000000000000000000" {
if candidate.String() != "xdc0000000000000000000000000000000000000000" {
candidatesWithStakeInfo = append(candidatesWithStakeInfo, utils.Masternode{Address: candidate, Stake: v})
}