Skip to main content
All CollectionsTroubleshooting
Long-running transactions
Long-running transactions

What are long-running transactions and how to cancel them

Updated over a week ago

Why doesn't my transaction complete?

If you have a transaction that doesn't complete it's likely due to the gas fee for it being set so low that it's not being picked up, which unfortunately holds up any subsequent transactions.

Wallets can only perform one transaction at a time

One of the technical limitations of wallets on the Ethereum blockchain is that they can only perform one transaction at a time and in order.

This unfortunately means that if you have a transaction that hasn't completed then you can't perform subsequent transactions until the transaction before it completes as the "stalled" transaction holds up the transaction queue.

This can happen if you set the gas fee for the transaction so low that it's not picked up and performed.

In this scenario you'll need to cancel the transaction by replacing it with another transaction on the same nonce.

What is a nonce?

The nonce of a transaction is its number in the queue (starting from 0):

Your first transaction:

Nonce 0

Your second transaction:

Nonce 1

Your third transaction:

Nonce 2

Since all transactions on Ethereum has to be performed in order, if your second transaction on nonce 1 stalls, then your third transaction on nonce 2 cannot be performed.

How are transactions cancelled?

Transactions on Ethereum can't exactly be cancelled, what you actually do is to replace the transaction with another transaction with higher gas (such as a transaction to yourself) and set that transaction to use the same nonce as the stalled transaction.

Since there can't be two transactions with the same nonce the new transaction will compete for completion with the previous one.

If the gas fee on the replacement transaction is set high enough for it to be more attractive to be picked up, then it will be picked up first and the stalled transaction will be dropped, effectively cancelling it.

How to cancel a transaction

The way you cancel transactions differs depending on which wallet you use, please refer to your wallet's documentation for help with this.

Not all wallets support setting a custom nonce or cancelling transactions.

Instructions for specific wallets

Wallet

Supports cancelling

Metamask

Yes (Guide)

Ledger

Yes (Guide)

Rainbow Wallet

Yes (Guide)

Phantom Wallet

Yes (Guide)

MyEtherWallet

Yes (Guide)

Coinbase Wallet

Yes (Guide)

Did this answer your question?