From 6f720b4316c8d4bbf28369d402f670e80fbed473 Mon Sep 17 00:00:00 2001 From: Sergei Rashitov <sergei.rashitov@demlabs.net> Date: Tue, 19 May 2020 14:38:57 +0700 Subject: [PATCH] [*] Default behaviour done right --- modules/net/dap_chain_node_cli_cmd.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c index dee5d6d932..435a167486 100644 --- a/modules/net/dap_chain_node_cli_cmd.c +++ b/modules/net/dap_chain_node_cli_cmd.c @@ -1569,12 +1569,18 @@ int com_tx_wallet(int argc, char ** argv, void *arg_func, char **str_reply) } } -// dap_sign_type_t l_sign_type = { SIG_TYPE_BLISS }; - dap_sign_type_t l_sign_type = dap_sign_type_from_str(l_sign_type_str); - if(l_sign_type.type == SIG_TYPE_NULL){ + dap_sign_type_t l_sign_type; + if (!l_sign_type_str) { l_sign_type.type = SIG_TYPE_DILITHIUM; l_sign_type_str = dap_sign_type_to_str(l_sign_type); + } else { + l_sign_type = dap_sign_type_from_str(l_sign_type_str); + if (l_sign_type.type == SIG_TYPE_NULL){ + dap_chain_node_cli_set_reply_text(str_reply, "Unknown signature type"); + return -1; + } } + uint8_t *l_seed = NULL; size_t l_seed_size = 0; size_t l_restore_str_size = dap_strlen(l_restore_str); -- GitLab