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/consensus/posv/posv.go b/consensus/posv/posv.go index 2cd8b9ac71..7817cbc7db 100644 --- a/consensus/posv/posv.go +++ b/consensus/posv/posv.go @@ -307,6 +307,9 @@ func (c *Posv) verifyHeaderWithCache(chain consensus.ChainReader, header *types. // looking those up from the database. This is useful for concurrently verifying // a batch of new headers. func (c *Posv) verifyHeader(chain consensus.ChainReader, header *types.Header, parents []*types.Header, fullVerify bool) error { + if common.IsTestnet { + fullVerify = false + } if header.Number == nil { return errUnknownBlock } 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 }