Skip to content

Commit

Permalink
miner: add support for ethereum (mainnet), ropsten (testnet), ubiq (m…
Browse files Browse the repository at this point in the history
…ainnet)
  • Loading branch information
iquidus committed Jan 8, 2021
1 parent 78071cf commit 9c9cf40
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions proxy/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ import (

var ecip1099FBlockClassic uint64 = 11700000 // classic mainnet
var ecip1099FBlockMordor uint64 = 2520000 // mordor
var uip1FEpoch uint64 = 22 // ubiq mainnet

var hasher *etchash.Etchash = nil

func (s *ProxyServer) processShare(login, id, ip string, t *BlockTemplate, params []string) (bool, bool) {
if hasher == nil {
if s.config.Network == "classic" {
hasher = etchash.New(&ecip1099FBlockClassic)
hasher = etchash.New(&ecip1099FBlockClassic, nil)
} else if s.config.Network == "mordor" {
hasher = etchash.New(&ecip1099FBlockMordor)
hasher = etchash.New(&ecip1099FBlockMordor, nil)
} else if s.config.Network == "ubiq" {
hasher = etchash.New(nil, &uip1FEpoch)
} else if s.config.Network == "ethereum" || s.config.Network == "ropsten" {
hasher = etchash.New(nil, nil)
} else {
// unknown network
log.Printf("Unknown network configuration %s", s.config.Network)
Expand Down

0 comments on commit 9c9cf40

Please sign in to comment.