ax(node): promote peer selection weights from var to const
Dimension weights are never reassigned — declaring them as mutable vars implies changeability that does not exist. Const declares what IS (AX §5). Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
8d89df10cc
commit
463708aeab
1 changed files with 7 additions and 7 deletions
|
|
@ -107,13 +107,13 @@ type PeerRegistry struct {
|
|||
saveStopOnce sync.Once // Ensure stopChan is closed only once
|
||||
}
|
||||
|
||||
// Dimension weights for peer selection
|
||||
// Lower ping, hops, geographic distance are better; higher score is better
|
||||
var (
|
||||
pingWeight = 1.0
|
||||
hopsWeight = 0.7
|
||||
geographicWeight = 0.2
|
||||
scoreWeight = 1.2
|
||||
// Dimension weights for peer selection.
|
||||
// Lower ping, hops, geographic distance are better; higher score is better.
|
||||
const (
|
||||
pingWeight = 1.0
|
||||
hopsWeight = 0.7
|
||||
geographicWeight = 0.2
|
||||
scoreWeight = 1.2
|
||||
)
|
||||
|
||||
// NewPeerRegistry creates a new PeerRegistry, loading existing peers if available.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue