Browse Source

Add bypassAddressValidation option

pool
Sammy Libre 8 years ago
parent
commit
31b977f6cc
  1. 1
      config.example.json
  2. 1
      go-pool/pool/pool.go
  3. 2
      go-pool/stratum/handlers.go

1
config.example.json

@ -1,5 +1,6 @@
{ {
"address": "46BeWrHpwXmHDpDEUmZBWZfoQpdc6HaERCNmx1pEYL2rAcuwufPN9rXHHtyUA4QVy66qeFQkn6sfK8aHYjA3jk3o1Bv16em", "address": "46BeWrHpwXmHDpDEUmZBWZfoQpdc6HaERCNmx1pEYL2rAcuwufPN9rXHHtyUA4QVy66qeFQkn6sfK8aHYjA3jk3o1Bv16em",
"bypassAddressValidation": false,
"threads": 2, "threads": 2,
"coin": "monero", "coin": "monero",

1
go-pool/pool/pool.go

@ -2,6 +2,7 @@ package pool
type Config struct { type Config struct {
Address string `json:"address"` Address string `json:"address"`
BypassAddressValidation bool `json:"bypassAddressValidation"`
Stratum Stratum `json:"stratum"` Stratum Stratum `json:"stratum"`
Daemon Daemon `json:"daemon"` Daemon Daemon `json:"daemon"`
Redis Redis `json:"redis"` Redis Redis `json:"redis"`

2
go-pool/stratum/handlers.go

@ -15,7 +15,7 @@ func init() {
} }
func (s *StratumServer) handleLoginRPC(cs *Session, params *LoginParams) (reply *JobReply, errorReply *ErrorReply) { func (s *StratumServer) handleLoginRPC(cs *Session, params *LoginParams) (reply *JobReply, errorReply *ErrorReply) {
if !util.ValidateAddress(params.Login, s.config.Address) { if !s.config.BypassAddressValidation && !util.ValidateAddress(params.Login, s.config.Address) {
errorReply = &ErrorReply{Code: -1, Message: "Invalid address used for login", Close: true} errorReply = &ErrorReply{Code: -1, Message: "Invalid address used for login", Close: true}
return return
} }

Loading…
Cancel
Save