We currently aren't erroring out properly for this specific case where:
nonce expires,
we proceed to poll for receipt in waitForConfirmation
we time out, leading us to
bump the tx (even though the nonce has expired).
Why are we unable to get a receipt in waitForConfirmation if the nonce is expired? Shouldn't that imply that the tx is mined, and there's no reason we should be unable to get the receipt? I don't know, because we're not erroring out properly in those cases. This is just a step to prevent unnecessary gas bumping on a dead tx.
The Solution
Using a flag, nonceExpired, if we get a timeout with the flag raised then we error out properly.
The Problem
We currently aren't erroring out properly for this specific case where:
Why are we unable to get a receipt in waitForConfirmation if the nonce is expired? Shouldn't that imply that the tx is mined, and there's no reason we should be unable to get the receipt? I don't know, because we're not erroring out properly in those cases. This is just a step to prevent unnecessary gas bumping on a dead tx.
The Solution
Using a flag, nonceExpired, if we get a timeout with the flag raised then we error out properly.