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?

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

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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