I make the following sequence of operations:
- Call sendTransaction -> receive tx hash
- Call getTransactionByHash - receive no transaction.
- Call sendTransaction for the same transaction a second later, I get “nonce too low”
- Call getTransactionByHash in a hope that nonce conflict received from the fact that tx was mined in that 1 second delay period -> receive no transaction
- Call sendTransaction with same parameters but with increased gasPrice from different account (limitation of my system that I can not use the same one) -> receive new tx hash
In the end, both tx hashes get mined and I have no way to make sure my tx is mined only once.
Is there any way to make sure sendTransaction and getTransactionByHash are consistent?
Is there any way to implement sendOrGetTransaction to make sure I can consistent result if tx is already mined - do not send it again?