I'm using MetaMask to make Ethereum transactions from my website, as described here: https://metamask.github.io/metamask-docs/Main_Concepts/Sending_Transactions
It works perfectly. I capture the transaction hash in the callback, then use it to track the transaction.
But I just noticed something; metamask has the option to "speed up" the transaction. I'm not sure exactly how it works, but this basically creates a new transaction with a larger gas price. However the callback is not called again.
I'm not sure exactly what it is doing. When I searched for the original transaction hash on an explorer, it doesn't exist. So they canceled it somehow?
I guess my problem is; how does my website know the original txhash is dead and receive the new txhash? How do people deal with this?
I also considered tracking the user transactions from the blockchain side, using subscribe to "Pending Transactions" function in web3, however this call cannot be filtered and so I get ALL pending transactions, not just transactions to my smart contract. This might be ok if I was running my own node, but I am using Infura. I would need to call Infura to get details on every pending transaction, probably they would ban me if I did that.
Does anyone have any insights?