fix(proxy): dispatch login events before splitter assignment
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
a79b35abaf
commit
8bde2c14d0
1 changed files with 3 additions and 10 deletions
|
|
@ -378,19 +378,12 @@ func (p *Proxy) acceptMiner(conn net.Conn, localPort uint16) {
|
|||
miner.globalDiff = p.config.CustomDiff
|
||||
miner.extNH = strings.EqualFold(p.config.Mode, "nicehash")
|
||||
miner.onLogin = func(m *Miner) {
|
||||
if p.splitter != nil {
|
||||
p.splitter.OnLogin(&LoginEvent{Miner: m})
|
||||
}
|
||||
if m.extNH {
|
||||
if m.MapperID() < 0 {
|
||||
return
|
||||
}
|
||||
} else if m.RouteID() < 0 {
|
||||
return
|
||||
}
|
||||
if p.events != nil {
|
||||
p.events.Dispatch(Event{Type: EventLogin, Miner: m})
|
||||
}
|
||||
if p.splitter != nil {
|
||||
p.splitter.OnLogin(&LoginEvent{Miner: m})
|
||||
}
|
||||
}
|
||||
miner.onSubmit = func(m *Miner, event *SubmitEvent) {
|
||||
if p.splitter != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue