From 8e1d99c35d50e52a2d5b40a41ee9a7e8d702d1a3 Mon Sep 17 00:00:00 2001
From: "cellframe.docs" <artur.khudiaev@demlabs.net>
Date: Fri, 11 Feb 2022 08:10:56 +0000
Subject: [PATCH] [*] Add patch to ticket 5443

---
 dap-sdk/crypto/test/crypto/CMakeLists.txt |  2 +-
 modules/net/dap_chain_node_cli_cmd.c      | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/dap-sdk/crypto/test/crypto/CMakeLists.txt b/dap-sdk/crypto/test/crypto/CMakeLists.txt
index ef6afe9d0c..8620c56c4b 100755
--- a/dap-sdk/crypto/test/crypto/CMakeLists.txt
+++ b/dap-sdk/crypto/test/crypto/CMakeLists.txt
@@ -4,7 +4,7 @@ project(crypto-test)
 # init CellFrame SDK
 add_definitions("-DDAP_VERSION=\"${CPACK_PACKAGE_VERSION_MAJOR}-${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\"")
 set(SUBMODULES_NO_BUILD ON)
-include (cellframe-sdk/cmake/OS_Detection.cmake)
+include (../../../../cmake/OS_Detection.cmake)
 set(DAPSDK_MODULES "core crypto network-core network-client network-server")
 
 # There is no need, as it was added in cellframe-sdk/CMakeLists.txt
diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c
index be8be7a104..94544747a4 100644
--- a/modules/net/dap_chain_node_cli_cmd.c
+++ b/modules/net/dap_chain_node_cli_cmd.c
@@ -3889,6 +3889,17 @@ int com_tx_create(int argc, char ** argv, char **str_reply)
         return -1;
     }
 
+    //
+    // Check, if network ID is same as ID in destination wallet address. If not - operation is cancelled.
+    //
+
+    if (addr_to->net_id.uint64 != l_net->pub.id.uint64)
+    {
+        dap_chain_node_cli_set_reply_text(str_reply, "destination wallet network ID=0x%llx and network ID=0x%llx is not equal. Please, change network name or wallet address", 
+                                            addr_to->net_id.uint64, l_net->pub.id.uint64);
+        return -1;
+    }
+
     dap_string_t *string_ret = dap_string_new(NULL);
     //g_string_printf(string_ret, "from=%s\nto=%s\nval=%lld\nfee=%s\nval_fee=%lld\n\n",
     //        addr_base58_from, addr_base58_to, value, addr_base58_fee, value_fee);
-- 
GitLab