if force specified will not check insufficient fund
This commit is contained in:
parent
fef5d65c0f
commit
9584c72026
@ -148,6 +148,7 @@ var sendCmd = &cli.Command{
|
||||
Params: params,
|
||||
}
|
||||
|
||||
if !cctx.Bool("force") {
|
||||
// Funds insufficient check
|
||||
fromBalance, err := api.WalletBalance(ctx, msg.From)
|
||||
if err != nil {
|
||||
@ -156,10 +157,8 @@ var sendCmd = &cli.Command{
|
||||
totalCost := types.BigAdd(types.BigMul(msg.GasFeeCap, types.NewInt(uint64(msg.GasLimit))), msg.Value)
|
||||
|
||||
if fromBalance.LessThan(totalCost) {
|
||||
fmt.Printf("From balance %s less than total cost %s\n", types.FIL(fromBalance), types.FIL(totalCost))
|
||||
if !cctx.Bool("force") {
|
||||
return fmt.Errorf("--force must be specified for this action to have an effect; " +
|
||||
"you have been warned")
|
||||
fmt.Printf("WARNING: From balance %s less than total cost %s\n", types.FIL(fromBalance), types.FIL(totalCost))
|
||||
return fmt.Errorf("--force must be specified for this action to have an effect; you have been warned")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user