11

If I send an Ethereum transaction that has not yet been confirmed by the network can I rebroadcast the same transaction with a higher fee and a new destination address?

2 Answers 2

11

With Geth, you can rebroadcast with a higher fee (gas price), but you cannot change the destination address.

eth.resend(tx, optional gas price, optional gas limit)

Example:

eth.sendTransaction({from: eth.accounts[0], to: "...", gasPrice: "1000"})
var tx = eth.pendingTransactions[0]
eth.resend(tx, web3.toWei(10, "szabo"))
1
  • broken anchor in the link
    – knocte
    Nov 18, 2017 at 5:33
1

Yes. If a miner sees two transactions with the same account and nonce, the software currently being run by most mining nodes will keep the transaction in their pending pool that has the higher gas price.

Note: I believe either Geth or Parity has some logic that will make it so it won't replace a transaction that has an insignificantly higher gas price (e.g., 1 attoeth). In this situation, the transaction the miner saw first will be mined. I don't know the exact details but I'm happy to update this answer if someone else does.

Your Answer

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

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