Skip to content

Commit d400d62

Browse files
committed
internal.ethapi.api: Only send callback if set
1 parent 0c05f9f commit d400d62

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

internal/ethapi/api.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,12 @@ func (a *Async) send(ctx context.Context, s *PublicTransactionPoolAPI, asyncArgs
332332
glog.V(logger.Info).Infof("Error encoding callback JSON: %v", err)
333333
return
334334
}
335-
_, err = http.Post(asyncArgs.CallbackUrl, "application/json", buf)
336-
if err != nil {
337-
glog.V(logger.Info).Infof("Error sending callback: %v", err)
338-
return
335+
if asyncArgs.CallbackUrl != "" {
336+
_, err = http.Post(asyncArgs.CallbackUrl, "application/json", buf)
337+
if err != nil {
338+
glog.V(logger.Info).Infof("Error sending callback: %v", err)
339+
return
340+
}
339341
}
340342
}()
341343
args, err := prepareSendTxArgs(ctx, asyncArgs.SendTxArgs, s.b)

0 commit comments

Comments
 (0)