1

I have a private key. I need to cancel a pending transaction sent from its address.

How to do this from command line?

Also: I need to do the exactly same thing if there are several such pending transactions, don't I?

6
  • Send a dummy transaction (does nothing) with the same private key and the same nonce, but with a higher gas-price. Jul 10, 2020 at 11:48
  • @goodvibration But which command line utility to use?
    – porton
    Jul 10, 2020 at 11:50
  • Same one you've used in order to send the transaction that you now want to cancel. Jul 10, 2020 at 11:53
  • @goodvibration The utility I used supports only deploying contracts, it does not support dummy transactions.
    – porton
    Jul 10, 2020 at 11:54
  • What is that utility then? Is it code? Jul 10, 2020 at 12:16

1 Answer 1

2

If you want to speed things up, you can either 'replace' or 'cancel' your original transaction by using the same nonce. Since you have the private key, you can use most common wallets or applications, such as Metamask, MyEtherWallet or MyCrypto who support this. You don't have to do it through the command line.

Replace

Re-submit your original transaction with the same nonce and a higher gas price. Check out a 'safe gas price' on ETH Gas watch. This will create a new transaction and will overwrite the first one, once it gets mined.

Cancel

Create a new transaction, to send 0 ETH to your own address, with the same nonce and a higher gas price. Check out a 'safe gas price' on ETH Gas watch.

This creates a new transaction and prevents previous from being mined, basically canceling the transaction. This is recommended as it is not guaranteed that the second transaction will be mined first and invalidating your first. So you could end up with your original transaction being mined first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.