Skip to content

Commit

Permalink
Prevent adding delegatebw upon newaccount, if there's nothing
Browse files Browse the repository at this point in the history
staked. Make `--transfer` invalid if nothing is staked (since its
a delegatebw option).
  • Loading branch information
abourget committed Dec 17, 2018
1 parent 8f748c9 commit c1d80c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eosc/cmd/systemNewaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ active:
errorCheck("--stake-net invalid", err)

doTransfer := viper.GetBool("system-newaccount-cmd-transfer")
actions = append(actions, system.NewDelegateBW(creator, newAccount, cpuStake, netStake, doTransfer))
if cpuStake.Amount != 0 || netStake.Amount != 0 {
actions = append(actions, system.NewDelegateBW(creator, newAccount, cpuStake, netStake, doTransfer))
} else if doTransfer {
errorCheck("--transfer invalid", fmt.Errorf("nothing was staked, so nothing to transfer"))
}

buyRAM := viper.GetString("system-newaccount-cmd-buy-ram")
if buyRAM != "" {
Expand Down

0 comments on commit c1d80c4

Please sign in to comment.