Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-wallet
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain-wallet
Commits
6e2e3be2
Commit
6e2e3be2
authored
5 years ago
by
alexander.lysikov
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into 'feature-2236'
Master See merge request
!3
parents
1561e731
fc2f0f6e
No related branches found
No related tags found
1 merge request
!3
Master
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+14
-2
14 additions, 2 deletions
CMakeLists.txt
dap_chain_wallet.c
+25
-8
25 additions, 8 deletions
dap_chain_wallet.c
dap_chain_wallet_ops.c
+23
-0
23 additions, 0 deletions
dap_chain_wallet_ops.c
with
62 additions
and
10 deletions
CMakeLists.txt
+
14
−
2
View file @
6e2e3be2
...
...
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
project
(
dap_chain_wallet
)
set
(
DAP_CHAIN_WALLET_SRCS
dap_chain_wallet.c
dap_chain_wallet.c
dap_chain_coin.c
dap_chain_wallet_ops.c
...
...
@@ -15,10 +15,22 @@ set(DAP_CHAIN_WALLET_HEADERS
dap_chain_wallet_ops.h
)
add_library
(
${
PROJECT_NAME
}
STATIC
${
DAP_CHAIN_WALLET_SRCS
}
${
DAP_CHAIN_WALLET_HEADERS
}
)
if
(
WIN32
)
include_directories
(
../libdap/src/win32/
)
include_directories
(
../3rdparty/libmemcached/
)
include_directories
(
../3rdparty/libmemcached/win32/
)
include_directories
(
../3rdparty/wepoll/include/
)
include_directories
(
../3rdparty/uthash/src/
)
include_directories
(
../3rdparty/libjson-c/
)
include_directories
(
../3rdparty/libmagic/src/
)
include_directories
(
../3rdparty/curl/include/
)
include_directories
(
../3rdparty/libsqlite3/
)
endif
()
add_library
(
${
PROJECT_NAME
}
STATIC
${
DAP_CHAIN_WALLET_SRCS
}
${
DAP_CHAIN_WALLET_HEADERS
}
)
target_link_libraries
(
dap_chain_wallet dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net
)
target_include_directories
(
dap_chain_wallet INTERFACE .
)
set
(
${
PROJECT_NAME
}
_DEFINITIONS CACHE INTERNAL
"
${
PROJECT_NAME
}
: Definitions"
FORCE
)
...
...
This diff is collapsed.
Click to expand it.
dap_chain_wallet.c
+
25
−
8
View file @
6e2e3be2
...
...
@@ -22,11 +22,29 @@
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#include
<string.h>
#include
<errno.h>
#include
<stdint.h>
#include
<stdlib.h>
#include
<stdio.h>
#include
<time.h>
#include
<stdlib.h>
#include
<stddef.h>
#include
<stdint.h>
#include
<string.h>
#include
<dirent.h>
#include
<errno.h>
#ifdef WIN32
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#include
<winsock2.h>
#include
<windows.h>
#include
<mswsock.h>
#include
<ws2tcpip.h>
#include
<io.h>
#include
<wepoll.h>
#endif
#include
<pthread.h>
#include
"dap_common.h"
#include
"dap_strfuncs.h"
#include
"dap_string.h"
...
...
@@ -34,9 +52,6 @@
#include
"dap_chain_wallet.h"
#include
"dap_chain_wallet_internal.h"
#define LOG_TAG "dap_chain_wallet"
#define LOG_TAG "dap_chain_wallet"
/**
...
...
@@ -85,6 +100,8 @@ const char* dap_chain_wallet_get_path(dap_config_t * a_config)
const
char
*
l_wallets_path
=
NULL
;
if
(
a_config
)
l_wallets_path
=
dap_config_get_item_str
(
g_config
,
"resources"
,
"wallets_path"
);
if
(
!
l_wallets_path
)
l_wallets_path
=
dap_config_get_item_str
(
g_config
,
"general"
,
"wallets_path"
);
return
l_wallets_path
;
}
...
...
@@ -109,7 +126,7 @@ dap_chain_wallet_t * dap_chain_wallet_create(const char * a_wallet_name, const c
size_t
l_file_name_size
=
strlen
(
a_wallet_name
)
+
strlen
(
a_wallets_path
)
+
13
;
l_wallet_internal
->
file_name
=
DAP_NEW_Z_SIZE
(
char
,
l_file_name_size
);
snprintf
(
l_wallet_internal
->
file_name
,
l_file_name_size
,
"%s/%s.dwallet"
,
a_wallets_path
,
a_wallet_name
);
dap_
snprintf
(
l_wallet_internal
->
file_name
,
l_file_name_size
,
"%s/%s.dwallet"
,
a_wallets_path
,
a_wallet_name
);
l_wallet_internal
->
certs
[
0
]
=
dap_chain_cert_generate_mem
(
a_wallet_name
,
dap_chain_sign_type_to_key_type
(
a_sig_type
));
...
...
@@ -342,7 +359,7 @@ dap_chain_wallet_t * dap_chain_wallet_open(const char * a_wallet_name, const cha
return
NULL
;
size_t
l_file_name_size
=
strlen
(
a_wallet_name
)
+
strlen
(
a_wallets_path
)
+
13
;
char
*
l_file_name
=
DAP_NEW_Z_SIZE
(
char
,
l_file_name_size
);
snprintf
(
l_file_name
,
l_file_name_size
,
"%s/%s.dwallet"
,
a_wallets_path
,
a_wallet_name
);
dap_
snprintf
(
l_file_name
,
l_file_name_size
,
"%s/%s.dwallet"
,
a_wallets_path
,
a_wallet_name
);
dap_chain_wallet_t
*
l_wallet
=
dap_chain_wallet_open_file
(
l_file_name
);
DAP_DELETE
(
l_file_name
);
return
l_wallet
;
...
...
This diff is collapsed.
Click to expand it.
dap_chain_wallet_ops.c
+
23
−
0
View file @
6e2e3be2
#include
<stdlib.h>
#include
<stdio.h>
#include
<time.h>
#include
<stdlib.h>
#include
<stddef.h>
#include
<stdint.h>
#include
<string.h>
#include
<errno.h>
#ifdef WIN32
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#include
<winsock2.h>
#include
<windows.h>
#include
<mswsock.h>
#include
<ws2tcpip.h>
#include
<io.h>
#include
<wepoll.h>
#endif
#include
<pthread.h>
#include
"dap_chain_common.h"
#include
"dap_chain_wallet_ops.h"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment