Skip to content

Commit 59d444c

Browse files
committed
Clarify message.
1 parent ead76fe commit 59d444c

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

cmd/transactioncancel.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"encoding/hex"
2020
"fmt"
2121
"math/big"
22+
"os"
2223

2324
"github.com/ethereum/go-ethereum/common"
2425
"github.com/ethereum/go-ethereum/core/types"
@@ -59,8 +60,21 @@ This will return an exit status of 0 if the transaction is successfully submitte
5960

6061
// Increase priority fee by 10% (+1 wei, to avoid rounding issues).
6162
feePerGas := new(big.Int).Add(new(big.Int).Add(tx.GasFeeCap(), new(big.Int).Div(tx.GasFeeCap(), big.NewInt(10))), big.NewInt(1))
63+
if debug {
64+
fmt.Fprintf(os.Stderr, "Fee per gas raised from %s to %s\n",
65+
string2eth.WeiToString(tx.GasFeeCap(), true),
66+
string2eth.WeiToString(feePerGas, true),
67+
)
68+
}
69+
6270
// Increase priority fee by 10% (+1 wei, to avoid rounding issues).
6371
priorityFeePerGas := new(big.Int).Add(new(big.Int).Add(tx.GasTipCap(), new(big.Int).Div(tx.GasTipCap(), big.NewInt(10))), big.NewInt(1))
72+
if debug {
73+
fmt.Fprintf(os.Stderr, "Priority fee per gas raised from %s to %s\n",
74+
string2eth.WeiToString(tx.GasTipCap(), true),
75+
string2eth.WeiToString(priorityFeePerGas, true),
76+
)
77+
}
6478

6579
// Ensure that the total fee per gas does not exceed the max allowed.
6680
totalFeePerGas := new(big.Int).Add(feePerGas, priorityFeePerGas)
@@ -69,7 +83,7 @@ This will return an exit status of 0 if the transaction is successfully submitte
6983
}
7084
maxFeePerGas, err := string2eth.StringToWei(viper.GetString("max-fee-per-gas"))
7185
cli.ErrCheck(err, quiet, "failed to obtain max fee per gas")
72-
cli.Assert(totalFeePerGas.Cmp(maxFeePerGas) <= 0, quiet, fmt.Sprintf("increased total fee per gas of %s too high; increase with --max-fee-per-gas if you are sure you want to do this", string2eth.WeiToString(totalFeePerGas, true)))
86+
cli.Assert(totalFeePerGas.Cmp(maxFeePerGas) <= 0, quiet, fmt.Sprintf("increased total fee per gas of %s higher than maximum allowed; increase with --max-fee-per-gas if you are sure you want to do this", string2eth.WeiToString(totalFeePerGas, true)))
7387

7488
// Create and sign the transaction.
7589
fromAddress, err := types.Sender(signer, tx)

0 commit comments

Comments
 (0)