@@ -880,14 +880,18 @@ func (c *chainClient) runBatchBroadcast() {
880880 submitBatch := func (toSubmit []sdk.Msg ) {
881881 res , err := c .SyncBroadcastMsg (toSubmit ... )
882882
883- if res .TxResponse .Code != 0 {
884- err = errors .Errorf ("error %d (%s): %s" , res .TxResponse .Code , res .TxResponse .Codespace , res .TxResponse .RawLog )
885- log .WithField ("txHash" , res .TxResponse .TxHash ).WithError (err ).Errorln ("failed to broadcast messages batch" )
883+ if err != nil {
884+ c .logger .WithError (err )
886885 } else {
887- log .WithField ("txHash" , res .TxResponse .TxHash ).Debugln ("msg batch broadcasted successfully at height" , res .TxResponse .Height )
886+ if res .TxResponse .Code != 0 {
887+ err = errors .Errorf ("error %d (%s): %s" , res .TxResponse .Code , res .TxResponse .Codespace , res .TxResponse .RawLog )
888+ c .logger .WithField ("txHash" , res .TxResponse .TxHash ).WithError (err ).Errorln ("failed to broadcast messages batch" )
889+ } else {
890+ c .logger .WithField ("txHash" , res .TxResponse .TxHash ).Debugln ("msg batch broadcasted successfully at height" , res .TxResponse .Height )
891+ }
888892 }
889893
890- log .Debugln ("gas wanted: " , c .gasWanted )
894+ c . logger .Debugln ("gas wanted: " , c .gasWanted )
891895 }
892896
893897 for {
@@ -2605,7 +2609,7 @@ func (c *chainClient) BroadcastMsg(broadcastMode txtypes.BroadcastMode, msgs ...
26052609 sequence := c .getAccSeq ()
26062610 c .txFactory = c .txFactory .WithSequence (sequence )
26072611 c .txFactory = c .txFactory .WithAccountNumber (c .accNum )
2608- log .Debugln ("retrying broadcastTx with nonce" , sequence )
2612+ c . logger .Debugln ("retrying broadcastTx with nonce" , sequence )
26092613 req , res , err = c .broadcastTx (c .ctx , c .txFactory , broadcastMode , msgs ... )
26102614 }
26112615 if err != nil {
0 commit comments