Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow splitting withdrawal txs #4384

Merged
merged 11 commits into from
May 23, 2019
Prev Previous commit
Next Next commit
small cleanup
  • Loading branch information
jleni committed May 21, 2019
commit e1bc2813f4c677e26193f892c77b6223d9f89f25
8 changes: 3 additions & 5 deletions x/distribution/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ func GetTxCmd(storeKey string, cdc *amino.Codec) *cobra.Command {
}

func splitGenerateOrBroadcast(cliCtx context.CLIContext, txBldr authtxb.TxBuilder, msgs []sdk.Msg) error {
jleni marked this conversation as resolved.
Show resolved Hide resolved
var lastErr error = nil

chunkSize := viper.GetInt(flagMaxMessagesPerTx)
jleni marked this conversation as resolved.
Show resolved Hide resolved
totalMessages := len(msgs)
if chunkSize == 0 {
Expand All @@ -60,9 +58,9 @@ func splitGenerateOrBroadcast(cliCtx context.CLIContext, txBldr authtxb.TxBuilde
sliceEnd = totalMessages
}
msgChunk := msgs[i:sliceEnd]
lastErr = utils.GenerateOrBroadcastMsgs(cliCtx, txBldr, msgChunk)
if lastErr != nil {
return lastErr
err = utils.GenerateOrBroadcastMsgs(cliCtx, txBldr, msgChunk)
if err != nil {
return err
}
}

Expand Down