fix: pool backup failover on reconnect, perfect dropper scripts, bcrypt password hashing
This commit is contained in:
@@ -46,6 +46,19 @@ func poolKey(cfg *Config) string {
|
||||
return fmt.Sprintf("%s:%d:tls=%v:wallet=%s", cfg.Host, cfg.Port, cfg.UseTLS, cfg.Wallet)
|
||||
}
|
||||
|
||||
// EnsurePoolWithBackups is like EnsurePool but also registers backup configs
|
||||
// that the proxy will rotate through on reconnect.
|
||||
func (m *Manager) EnsurePoolWithBackups(cfg *Config, backups []Config) (*Proxy, error) {
|
||||
p, err := m.EnsurePool(cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(backups) > 0 {
|
||||
p.SetBackupConfigs(backups)
|
||||
}
|
||||
return p, nil
|
||||
}
|
||||
|
||||
// EnsurePool returns a connected proxy for the forged pool settings, starting one if needed.
|
||||
func (m *Manager) EnsurePool(cfg *Config) (*Proxy, error) {
|
||||
if cfg == nil || cfg.Host == "" {
|
||||
|
||||
Reference in New Issue
Block a user