From bb4aebb9b8f1538b19ee66ac28d5b5b239cb00a0 Mon Sep 17 00:00:00 2001
From: "alexey.stratulat" <alexey.stratulat@demlabs.net>
Date: Mon, 22 Jul 2024 17:01:31 +0700
Subject: [PATCH] [*] Fixed output of the list of signatures with which a
 wallet is created when using multi-signature.

---
 modules/net/dap_chain_node_cli_cmd.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c
index bf3a6a684e..78597f3369 100644
--- a/modules/net/dap_chain_node_cli_cmd.c
+++ b/modules/net/dap_chain_node_cli_cmd.c
@@ -2176,7 +2176,16 @@ int l_arg_index = 1, l_rc, cmd_num = CMD_NONE;
                     const char *l_addr_str = dap_chain_addr_to_str(l_addr);
                     json_object * json_obj_wall = json_object_new_object();
                     json_object_object_add(json_obj_wall, "Wallet name", json_object_new_string(l_wallet->name));
-                    json_object_object_add(json_obj_wall, "Sign type", json_object_new_string(l_sign_type_str));
+                    if (l_sign_count > 1) {
+                        dap_string_t *l_signs_types_str = dap_string_new("sig_multi_chained, ");
+                        for (size_t i = 0; i < l_sign_count; i++) {
+                            dap_string_append_printf(l_signs_types_str, "%s%s",
+                                                     dap_sign_type_to_str(l_sign_types[i]), (i+1) == l_sign_count ? "": ", ");
+                        }
+                        json_object_object_add(json_obj_wall, "Sign type", json_object_new_string(l_signs_types_str->str));
+                        dap_string_free(l_signs_types_str, true);
+                    } else
+                        json_object_object_add(json_obj_wall, "Sign type", json_object_new_string(l_sign_type_str));
                     json_object_object_add(json_obj_wall, "Status", json_object_new_string("successfully created"));
                     if ( l_addr_str ) {
                         json_object_object_add(json_obj_wall, "new address", json_object_new_string(l_addr_str));
-- 
GitLab