Skip to content

Commit 24846dc

Browse files
committed
ignore rpcOpts when rpcurl is set directly
1 parent d0a15e3 commit 24846dc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
2-
.idea/
2+
.idea/
3+
cmd/mevrepl/mevrepl

protect/client.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func ConstructClient(privateKey *ecdsa.PrivateKey, network string, opts *ClientO
110110

111111
if opts.FlashbotsRPC != "" {
112112
flashbotsRPCURL = opts.FlashbotsRPC
113+
opts.RPCOpts = ""
113114
}
114115

115116
if opts.FlashbotsRelay != "" {
@@ -120,7 +121,11 @@ func ConstructClient(privateKey *ecdsa.PrivateKey, network string, opts *ClientO
120121
opts.HTTPClient = http.DefaultClient
121122
}
122123

123-
flashbotsRPCClient, err := ethclient.Dial(flashbotsRPCURL + "/" + opts.RPCOpts)
124+
url := flashbotsRPCURL
125+
if opts.RPCOpts != "" {
126+
url = flashbotsRPCURL + "/" + opts.RPCOpts
127+
}
128+
flashbotsRPCClient, err := ethclient.Dial(url)
124129
if err != nil {
125130
return nil, err
126131
}
@@ -196,7 +201,6 @@ func (c *Client) SendEthBundle(ctx context.Context, bundle *SendBundleArgs) (*Se
196201
}
197202

198203
return &bundleResp, nil
199-
200204
}
201205

202206
func (c *Client) SimulateMEVBundle(ctx context.Context, bundle *rpctypes.MevSendBundleArgs) (*SimulateBundleResponse, error) {
@@ -234,7 +238,6 @@ func (c *Client) CancelEthBundle(ctx context.Context, cancelArgs CancelETHBundle
234238
}
235239

236240
return err
237-
238241
}
239242

240243
func (c *Client) SendPrivateRawRelayTx(ctx context.Context, tx *types.Transaction, builders ...string) (hexutil.Bytes, error) {
@@ -269,7 +272,6 @@ func (c *Client) SendPrivateRelayTx(ctx context.Context, tx *types.Transaction)
269272

270273
err = c.FlashbotsRelay.CallFor(ctx, &resp, "eth_sendPrivateTransaction", args)
271274
return resp, err
272-
273275
}
274276

275277
func (c *Client) SetFeeRefundRecipient(ctx context.Context, signer common.Address, deligateAddr common.Address) error {
@@ -306,7 +308,6 @@ func (c *Client) CancelPrivateRelayTx(ctx context.Context, txHash common.Hash) e
306308
if resp.Error != nil {
307309
slog.Error("ETH cancel private transaction", "err", resp.Error.Message)
308310
} else {
309-
310311
slog.Info("ETH cancel private transaction", "res", resp.Result)
311312
}
312313

0 commit comments

Comments
 (0)