Skip to content

Commit

Permalink
Fix rpc name override
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaidashenko committed Jan 18, 2024
1 parent 286c8c0 commit 50a2e1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/chains/legacyevm/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,19 @@ func newEthClientFromCfg(cfg evmconfig.NodePool, noNewHeadsThreshold time.Durati
for i, node := range nodes {
if node.SendOnly != nil && *node.SendOnly {
name := fmt.Sprintf("eth-sendonly-rpc-%d", i)
if node.Name != nil && *node.Name != "" {
name = *node.Name
}
rpc := evmclient.NewRPCClient(lggr, empty, (*url.URL)(node.HTTPURL), name, int32(i), chainID,
commonclient.Secondary)
sendonly := commonclient.NewSendOnlyNode[*big.Int, evmclient.RPCCLient](lggr, (url.URL)(*node.HTTPURL),
*node.Name, chainID, rpc)
sendonlys = append(sendonlys, sendonly)
} else {
name := fmt.Sprintf("eth-primary-rpc-%d", i)
if node.Name != nil && *node.Name != "" {
name = *node.Name
}
rpc := evmclient.NewRPCClient(lggr, (url.URL)(*node.WSURL), (*url.URL)(node.HTTPURL), name, int32(i),
chainID, commonclient.Primary)
primaryNode := commonclient.NewNode[*big.Int, *evmtypes.Head, evmclient.RPCCLient](cfg, noNewHeadsThreshold,
Expand Down

0 comments on commit 50a2e1a

Please sign in to comment.