Since transactions require a nonce that is one more than the previously mined transaction for a given address, what happens if someone sent a transaction with a low gas price that was refused by miners? They would have all subsequent transactions refused unless they were given the same nonce and a more favourable gas price.
1 Answer
You're correct that all subsequent transactions would be refused.
So with Geth, you can rebroadcast with a higher fee (gas price) by using eth.resend
(the nonce will remain the same).
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(20, "GWei"))
-
1That's pretty neat if you happen to have a geth node. I guess for the record, if you wanted to implement the above using web3, you could use 'getTransaction' to obtain it and then modify the gas price on that object, then resend using the normal sendTransaction method?– bozzleJul 18, 2016 at 10:11
-
1Sounds good to me; I haven't tried with web3 though. Feel free to post that answer too and any others that you find that works.– eth ♦Jul 18, 2016 at 10:35