Skip to content

Commit

Permalink
internal.ethapi.api: Only send callback if set
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmn committed Dec 20, 2016
1 parent 0c05f9f commit d400d62
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,12 @@ func (a *Async) send(ctx context.Context, s *PublicTransactionPoolAPI, asyncArgs
glog.V(logger.Info).Infof("Error encoding callback JSON: %v", err)
return
}
_, err = http.Post(asyncArgs.CallbackUrl, "application/json", buf)
if err != nil {
glog.V(logger.Info).Infof("Error sending callback: %v", err)
return
if asyncArgs.CallbackUrl != "" {
_, err = http.Post(asyncArgs.CallbackUrl, "application/json", buf)
if err != nil {
glog.V(logger.Info).Infof("Error sending callback: %v", err)
return
}
}
}()
args, err := prepareSendTxArgs(ctx, asyncArgs.SendTxArgs, s.b)
Expand Down

0 comments on commit d400d62

Please sign in to comment.