diff --git a/api.json b/api.json index 860a645..5f6be5f 100644 --- a/api.json +++ b/api.json @@ -1,10 +1,10 @@ { "threads": 4, - "coin": "etc", + "coin": "ubiq", "name": "main", "pplns": 9000, - "network": "classic", - "coin-name":"etc", + "network": "ubiq", + "coin-name":"ubq", "proxy": { "enabled": true, @@ -98,7 +98,7 @@ "exchange": { "enabled": true, - "url": "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=ethereum-classic", + "url": "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=ubiq", "timeout": "50s", "refreshInterval": "900s" }, diff --git a/proxy/blocks.go b/proxy/blocks.go index 936eedd..c71aefd 100644 --- a/proxy/blocks.go +++ b/proxy/blocks.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" + "github.com/ubiq/go-ubiq/common" "github.com/yuriy0803/open-etc-pool-friends/rpc" "github.com/yuriy0803/open-etc-pool-friends/util" ) diff --git a/proxy/miner.go b/proxy/miner.go index 3e47a9d..878ac65 100644 --- a/proxy/miner.go +++ b/proxy/miner.go @@ -6,36 +6,14 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/yuriy0803/etchash" + "github.com/ubiq/go-ubiq/common" + "github.com/yuriy0803/ubqhash" ) -var ( - maxUint256 = new(big.Int).Exp(big.NewInt(2), big.NewInt(256), big.NewInt(0)) - ecip1099FBlockClassic uint64 = 11700000 // classic mainnet - ecip1099FBlockMordor uint64 = 2520000 // mordor - uip1FEpoch uint64 = 22 // ubiq mainnet - hasher *etchash.Etchash = nil -) +var hasher = ubqhash.New() 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, nil) - } else if s.config.Network == "mordor" { - 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) - return false, false - } - } - nonceHex := params[0] hashNoNonce := params[1] mixDigest := params[2]