Skip to content

Commit

Permalink
remove duplicate initialization of multiClient
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaidashenko committed Jan 14, 2025
1 parent 2f48e18 commit 10eec3e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/solana/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ func newChain(id string, cfg *config.TOMLConfig, ks core.Keystore, lggr logger.L

var tc internal.Loader[client.ReaderWriter] = utils.NewLazyLoad(func() (client.ReaderWriter, error) { return ch.getClient() })
var bc internal.Loader[monitor.BalanceClient] = utils.NewLazyLoad(func() (monitor.BalanceClient, error) { return ch.getClient() })
// getClient returns random client or if MultiNodeEnabled RPC picked and controlled by MultiNode
ch.multiClient = client.NewMultiClient(ch.getClient)

// txm will default to sending transactions using a single RPC client if sendTx is nil
Expand Down Expand Up @@ -293,9 +294,6 @@ func newChain(id string, cfg *config.TOMLConfig, ks core.Keystore, lggr logger.L

ch.multiNode = multiNode
ch.txSender = txSender
ch.multiClient = client.NewMultiClient(func() (client.ReaderWriter, error) {
return ch.multiNode.SelectRPC()
})

// clientCache will not be used if multinode is enabled
ch.clientCache = nil
Expand Down

0 comments on commit 10eec3e

Please sign in to comment.