Skip to content

Commit 4e751ff

Browse files
author
brucexc
committed
fix: getNode check
1 parent 6f897ce commit 4e751ff

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

internal/service/hub/handler/nta/node_info.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ func (n *NTA) getNode(ctx context.Context, address common.Address) (*schema.Node
133133
}
134134
}
135135

136-
nodeInfo, err := n.stakingContract.GetNode(&bind.CallOpts{}, address)
137-
if err != nil {
138-
if node.Type == schema.NodeTypeRSSHub.String() && node.ID.Cmp(big.NewInt(10000)) >= 0 {
139-
node.ReliabilityScore = decimal.NewFromFloat(0)
140-
node.Status = schema.NodeStatusRegistered
136+
if node.Type == schema.NodeTypeRSSHub.String() && node.ID.Cmp(big.NewInt(10000)) >= 0 {
137+
node.ReliabilityScore = decimal.NewFromFloat(0)
138+
node.Status = schema.NodeStatusRegistered
141139

142-
return node, nil
143-
}
140+
return node, nil
141+
}
144142

143+
nodeInfo, err := n.stakingContract.GetNode(&bind.CallOpts{}, address)
144+
if err != nil {
145145
return nil, fmt.Errorf("get Node from chain: %w", err)
146146
}
147147

0 commit comments

Comments
 (0)