From ae5368af505b1d237b4fa2b2efd26e4abb44e653 Mon Sep 17 00:00:00 2001 From: Tuna Date: Tue, 12 Feb 2019 15:28:42 +0700 Subject: [PATCH] testnet: validate masternode role --- common/constants.go | 2 +- eth/backend.go | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/common/constants.go b/common/constants.go index 480c9ecbba..6b483d9b2c 100644 --- a/common/constants.go +++ b/common/constants.go @@ -21,7 +21,7 @@ const ( ) var TIP2019Block = big.NewInt(1050000) -var IsTestnet bool = false +var IsTestnet = false var StoreRewardFolder string var RollbackHash Hash var MinGasPrice int64 diff --git a/eth/backend.go b/eth/backend.go index 2b19db2fbf..99074c8ac0 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -580,6 +580,19 @@ func (s *Ethereum) ValidateMasternode() (bool, error) { } else { return false, fmt.Errorf("Only verify masternode permission in PoSV protocol") } + if common.IsTestnet { + masternodes := []common.Address{ + common.HexToAddress("0xfFC679Dcdf444D2eEb0491A998E7902B411CcF20"), + common.HexToAddress("0xd76fd76F7101811726DCE9E43C2617706a4c45c8"), + common.HexToAddress("0x8A97753311aeAFACfd76a68Cf2e2a9808d3e65E8"), + } + for _, m := range masternodes { + if m == eb { + return true, nil + } + } + return false, nil + } return true, nil }