# วิธีการยกเลิก pending transaction (ธุรกรรมที่ค้าง) ใน Metamask

By [The Web3 Explorer: Navigating Crypto and DeFi](https://paragraph.com/@web3explorer) · 2023-04-02

wallet, metamask, ethereum

---

ใครที่ใช้งาน Ethereum chain คงต้องเคยเจอเหตุการณ์ที่ transaction ไม่สำเร็จและค้างเติ่งไม่ไปไหน ทำ transaction ต่อไปก็ไม่ได้ เพราะจะไปต่อคิวค้างเต็มไปหมด ซึ่งวิธีการแก้ไม่ยาก แต่ต้องเสีย gas เพิ่มดังนี้

1.  เปิดกระเป๋าเงิน MetaMask และไปที่แท็บ "Activity" หรือเข้าไปดูที่ หน้า wallet ของตัวเองใน [Etherscan](https://etherscan.io/)
    
2.  หา transaction ที่รอดำเนินการอยู่และจดบันทึกหมายเลข nonce
    
3.  สร้าง transaction ใหม่โดยมี nonce เดียวกันกับ transaction ที่รอดำเนินการอยู่ แต่มีค่า gas price สูงกว่า โดยเช็คค่า gas ได้จาก [blocknative](https://www.blocknative.com/gas-estimator) (ตั้งค่าตามบล็อก **99% Probability** และต้องมากกว่าค่า gas เดิม)
    
    ![](https://storage.googleapis.com/papyrus_images/aab2b74f0e43dbb831969961366fa008.png)
    
    [https://www.blocknative.com/gas-estimator](https://www.blocknative.com/gas-estimator)
    
    ![](https://storage.googleapis.com/papyrus_images/1f5360ed9c0e76ecc1168cf13fbace4b.png)
    
    เลือก advanced gas fee เพื่อตั้งค่า gas เอง
    

โดย transaction ที่สร้างใหม่จะเป็นอันเดียวกับที่ค้าง (approve/โอนเหรียญ/mint etc.) หรือใช้วิธีส่งเหรียญ 0 ETH หา address ตัวเองก็ได้

4.  เมื่อส่ง transaction ใหม่แล้ว ให้รอได้รับการยืนยันบนบล็อกเชน
    
5.  เมื่อ transaction ใหม่ได้รับการยืนยันแล้ว มันจะแทนที่ transaction ที่รอดำเนินการอยู่ด้วย nonce เดียวกัน transaction เดิมจะถูกยกเลิก จากนั้นเราก็สามารถทำ transaction ได้ตามปกติ
    

ปล. เปิดการตั้งค่า nonce ที่ metamask โดยเข้าไปที่ Settings > Advanced

![](https://storage.googleapis.com/papyrus_images/693b1cff02713c4c048ed28304ae6ddc.png)

---

*Originally published on [The Web3 Explorer: Navigating Crypto and DeFi](https://paragraph.com/@web3explorer/how-to-cancel-pending-ethereum-transaction)*
