Browse Source

Merge pull request #2 from yuriy0803/SOLO-ETC

Update
master
yuriy0803 5 years ago committed by GitHub
parent
commit
9715dce27e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md
  2. 2
      api.json
  3. 11
      storage/redis.go

2
README.md

@ -1,4 +1,4 @@
## Open Source Ethereum Classic Mining Pool PPLNS ## Open Source Ethereum Classic Mining Pool SOLO
Donations Donations
ETC: 0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6 ETC: 0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6

2
api.json

@ -2,7 +2,7 @@
"threads": 2, "threads": 2,
"coin": "etc", "coin": "etc",
"name": "main", "name": "main",
"pplns": 9000, "pplns": 0,
"network": "classic", "network": "classic",
"proxy": { "proxy": {

11
storage/redis.go

@ -440,10 +440,15 @@ func (r *RedisClient) WriteBlock(login, id string, params []string, diff, roundD
} }
func (r *RedisClient) writeShare(tx *redis.Multi, ms, ts int64, login, id string, diff int64, expire time.Duration) { func (r *RedisClient) writeShare(tx *redis.Multi, ms, ts int64, login, id string, diff int64, expire time.Duration) {
times := int(diff / 1000000000) /* # Note To Me:
for i := 0; i < times; i++ { Will have to write to get from redis the current value for round
shares and increase by 1, then include the new number to be added to redis
*/
// Moved get hostname to stratums
tx.LPush(r.formatKey("lastshares"), login) tx.LPush(r.formatKey("lastshares"), login)
}
tx.LTrim(r.formatKey("lastshares"), 0, r.pplns) tx.LTrim(r.formatKey("lastshares"), 0, r.pplns)
tx.HIncrBy(r.formatKey("shares", "roundCurrent"), login, diff) tx.HIncrBy(r.formatKey("shares", "roundCurrent"), login, diff)
tx.ZAdd(r.formatKey("hashrate"), redis.Z{Score: float64(ts), Member: join(diff, login, id, ms)}) tx.ZAdd(r.formatKey("hashrate"), redis.Z{Score: float64(ts), Member: join(diff, login, id, ms)})

Loading…
Cancel
Save