For example, if you initiate a transaction on the front-end page or directly use metamask's wallet, but find that the transaction does not pop up to indicate whether it succeeds or fails. At this time, the transaction may be stuck and in the pending state.
On a blockchain browser, if you use the public chain of the blockchain browser you currently use in the metamask wallet, the transaction initiated can be searched on the blockchain browser. You can search by searching the address of your wallet or the address of the recipient's wallet. However, if the transaction is suspended (i.e. stuck as I said before), that is, in the pending state, the suspended transaction must be overwritten, otherwise the transaction cannot be initiated later.There are two ways to override pending transactions:
【1】 Simple method. The corresponding transaction value of nosk can be set manually after the transaction is suspended. In this way, the corresponding transaction value of nosk can be set directly after the transaction is suspended. Specific operation steps: Avatar in the upper right corner of metamask Wallet - Settings - Advanced: change the advanced fuel control to enabled, and then change the custom transaction nonce to enabled.
【2】 Using the Web3 method, set nonce in the method to cover the suspended transactions. At present, I have not implemented this method.
However, the sendtransaction method should be used, because this method has a parameter, nonce, which is used to overwrite the nonce of the previous transaction
Why the transaction is "stuck":
The reason may be that the gas fee is too low. If the miner thinks the gas fee is too low, the miner will not verify the transaction, so the transaction cannot become a block on a public chain. Naturally, it means that the transaction cannot be completed, that is, it means that it cannot be connected to the chain.
Among them, there may be many stuck transactions, so as long as the transaction with nonce of 0 is not covered, other transactions will be stuck. Where, nonce means "transaction number".
————————————————