Skip to content

Commit

Permalink
Merge pull request #1024 from threefoldtech/development_proxy_extraFe…
Browse files Browse the repository at this point in the history
…eNodeAsDedicated

consider nodes with extra-fees as dedicated
  • Loading branch information
Omarabdul3ziz authored May 21, 2024
2 parents c694a79 + 88009cd commit 412f1c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grid-proxy/internal/explorer/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func nodeFromDBNode(info db.Node) types.Node {
PriceUsd: math.Round(info.PriceUsd*1000) / 1000,
}
node.Status = nodestatus.DecideNodeStatus(node.Power, node.UpdatedAt)
node.Dedicated = info.FarmDedicated || info.NodeContractsCount == 0 || info.Renter != 0
node.Dedicated = info.FarmDedicated || info.NodeContractsCount == 0 || info.Renter != 0 || info.ExtraFee > 0
return node
}

Expand Down Expand Up @@ -161,7 +161,7 @@ func nodeWithNestedCapacityFromDBNode(info db.Node) types.NodeWithNestedCapacity
PriceUsd: math.Round(info.PriceUsd*1000) / 1000,
}
node.Status = nodestatus.DecideNodeStatus(node.Power, node.UpdatedAt)
node.Dedicated = info.FarmDedicated || info.NodeContractsCount == 0 || info.Renter != 0
node.Dedicated = info.FarmDedicated || info.NodeContractsCount == 0 || info.Renter != 0 || info.ExtraFee > 0
return node
}

Expand Down
3 changes: 2 additions & 1 deletion grid-proxy/tests/queries/mock_client/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import (
func isDedicatedNode(db DBData, node Node) bool {
return db.Farms[node.FarmID].DedicatedFarm ||
len(db.NonDeletedContracts[node.NodeID]) == 0 ||
db.NodeRentedBy[node.NodeID] != 0
db.NodeRentedBy[node.NodeID] != 0 ||
db.Nodes[node.NodeID].ExtraFee > 0
}

func isRentable(db DBData, node Node) bool {
Expand Down

0 comments on commit 412f1c2

Please sign in to comment.