fix: pool backup failover on reconnect, perfect dropper scripts, bcrypt password hashing

This commit is contained in:
drjones
2026-05-30 12:49:40 -07:00
parent 9eaf1e82ac
commit 0e19eb9eb9
7 changed files with 276 additions and 110 deletions

View File

@@ -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 == "" {