From 8a261d4d4afa352f8a2d218cfaeb5220b259dc93 Mon Sep 17 00:00:00 2001
From: Erdem Erdyniev <erdem.erdyniev@demlabs.net>
Date: Tue, 4 Feb 2025 13:43:30 +0700
Subject: [PATCH] [*]web3:GetMempoolTxHash: fixed error handling

---
 chain/wallet/handlers/MempoolCheckCommand.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/chain/wallet/handlers/MempoolCheckCommand.cpp b/chain/wallet/handlers/MempoolCheckCommand.cpp
index 5e47b53f..7d26b75d 100644
--- a/chain/wallet/handlers/MempoolCheckCommand.cpp
+++ b/chain/wallet/handlers/MempoolCheckCommand.cpp
@@ -33,6 +33,15 @@ QVariant MempoolCheckCommand::respondToClient(const QVariant &args)
     {
         auto resultValue = cmdList->getJsonResult(requestDoc, "mempool check").result.toArray();
         mempoolAnswer = resultValue[0].toObject();
+
+        if(!mempoolAnswer["errors"].isNull())
+        {
+            QJsonArray errArr = mempoolAnswer["errors"].toArray();
+            if (!errArr.isEmpty())
+            {
+                errorMsg = errArr[0].toObject()["message"].toString();
+            }
+        }
     }
 
     if(args.toStringList().contains(WEB3_KEY))
-- 
GitLab