From 88009cdd48722e128a735998a914055ef01f945c Mon Sep 17 00:00:00 2001 From: Omar Abdulaziz Date: Tue, 21 May 2024 14:32:49 +0300 Subject: [PATCH] consider nodes with extra-fees as dedicated --- grid-proxy/internal/explorer/converters.go | 4 ++-- grid-proxy/tests/queries/mock_client/nodes.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/grid-proxy/internal/explorer/converters.go b/grid-proxy/internal/explorer/converters.go index a2017dc7d..de70844f6 100644 --- a/grid-proxy/internal/explorer/converters.go +++ b/grid-proxy/internal/explorer/converters.go @@ -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 } @@ -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 } diff --git a/grid-proxy/tests/queries/mock_client/nodes.go b/grid-proxy/tests/queries/mock_client/nodes.go index 63bf48e79..db8217312 100644 --- a/grid-proxy/tests/queries/mock_client/nodes.go +++ b/grid-proxy/tests/queries/mock_client/nodes.go @@ -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 {