Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions include/ccoin/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ ccoininclude_HEADERS = \
parr.h \
script.h \
serialize.h \
util.h \
wallet.h
util.h

ccoinnetincludedir=$(includedir)/ccoin/net

Expand All @@ -46,8 +45,10 @@ ccoinnetinclude_HEADERS = \
net/netbase.h \
net/peerman.h

ccoinaesincludedir = $(includedir)/ccoin/crypto
ccoinwalletincludedir = $(includedir)/ccoin

ccoinaesinclude_HEADERS = \
ccoinwalletinclude_HEADERS = \
crypto/aes_util.h \
crypto/ctaes.h
crypto/ctaes.h \
wallet/wallet.h

12 changes: 7 additions & 5 deletions include/ccoin/wallet.h → include/ccoin/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.
*/

#include <stdint.h>
#include <stdbool.h>
#include <ccoin/cstr.h>
#include <ccoin/parr.h>
#include <ccoin/cstr.h> // for cstring
#include <ccoin/parr.h> // for parr_idx, parr

#include <stdbool.h> // for bool
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -71,4 +73,4 @@ extern bool wallet_valid_name(const char *name);
}
#endif

#endif
#endif /* __LIBCCOIN_WALLET_H__ */
12 changes: 6 additions & 6 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ libccoin_la_SOURCES= \
script_sign.c \
serialize.c \
util.c \
utxo.c \
wallet.c
utxo.c

noinst_LTLIBRARIES= libccoinnet.la libccoinaes.la
noinst_LTLIBRARIES= libccoinnet.la libccoinwallet.la

libccoinnet_la_SOURCES= \
net/dns.c \
net/net.c \
net/netbase.c \
net/peerman.c

libccoinaes_la_SOURCES= \
crypto/aes_util.c \
crypto/ctaes.c
libccoinwallet_la_SOURCES= \
crypto/aes_util.c \
crypto/ctaes.c \
wallet/wallet.c
29 changes: 16 additions & 13 deletions lib/wallet.c → lib/wallet/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@
*/
#include "picocoin-config.h"

#include <ccoin/address.h>
#include <ccoin/coredefs.h>
#include <ccoin/key.h>
#include <ccoin/mbr.h>
#include <ccoin/message.h>
#include <ccoin/wallet.h>
#include <ccoin/hdkeys.h>
#include <ccoin/serialize.h>
#include <ccoin/util.h>

#include <ctype.h>
#include <assert.h>
#include <stdio.h>
#include <ccoin/address.h> // for bp_pubkey_get_address
#include <ccoin/buffer.h> // for const_buffer
#include <ccoin/coredefs.h> // for chain_info, etc
#include <ccoin/hdkeys.h> // for hd_extended_key_free, etc
#include <ccoin/key.h> // for bp_key_free, bp_key, etc
#include <ccoin/mbr.h> // for mbr_free, mbuf_reader, etc
#include <ccoin/message.h> // for p2p_message, etc
#include <ccoin/serialize.h> // for deser_u32, deser_varstr, etc
#include <ccoin/util.h> // for ARRAY_SIZE
#include <ccoin/wallet/wallet.h> // for wallet, wallet_account, etc

#include <assert.h> // for assert
#include <ctype.h> // for isalnum
#include <stdio.h> // for NULL, fprintf, stderr
#include <stdlib.h> // for free, calloc
#include <string.h> // for memset, strncmp, strcmp, etc

static void account_free(struct wallet_account *acct);

Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ brd_LDADD = $(top_builddir)/lib/libccoin.la \
picocoin_SOURCES= \
main.c \
picocoin.h \
wallet.c wallet.h
wallet.c wallet.h

picocoin_LDADD = $(top_builddir)/lib/libccoin.la \
$(top_builddir)/lib/libccoinnet.la \
$(top_builddir)/lib/libccoinaes.la \
$(top_builddir)/lib/libccoinwallet.la \
@GMP_LIBS@ @ARGP_LIBS@ \
@EVENT_LIBS@ @JANSSON_LIBS@

Expand Down
7 changes: 4 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@

#include "wallet.h" // for cur_wallet_addresses, etc

#include <event2/event.h> // for event_free, event_base_new, etc
#include <jansson.h> // for json_decref, json_dumpf, etc

#include <argp.h>
#include <assert.h> // for assert
#include <stdbool.h> // for bool
#include <ctype.h> // for isspace
#include <errno.h> // for errno
#include <event2/event.h> // for event_free, event_base_new, etc
#include <fcntl.h> // for open
#include <stdio.h> // for fprintf, printf, NULL, etc
#include <stdlib.h> // for free, exit
#include <string.h> // for strcmp, strdup, strlen, etc
#include <jansson.h>

enum command_type {
CMD_CHAIN_SET,
Expand Down Expand Up @@ -668,4 +669,4 @@ int main (int argc, char *argv[])
free(log_state);

return 0;
}
}
3 changes: 1 addition & 2 deletions src/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <ccoin/hexcode.h> // for encode_hex
#include <ccoin/key.h> // for bp_privkey_get, etc
#include <ccoin/parr.h> // for parr, parr_idx
#include <ccoin/wallet.h> // for wallet, wallet_free, etc
#include <ccoin/wallet/wallet.h> // for wallet, ser_wallet, etc
#include <ccoin/compat.h> // for parr_new

#include <jansson.h> // for json_object_set_new, etc
Expand Down Expand Up @@ -447,4 +447,3 @@ void cur_wallet_defaultAccount(const char *acct_name)
return;
}
}

2 changes: 1 addition & 1 deletion src/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ extern void cur_wallet_dump(void);
extern void cur_wallet_addresses(void);
extern void cur_wallet_free(void);

#endif /* __PICOCOIN_WALLET_H__ */
#endif /* __PICOCOIN_WALLET_H__ */
6 changes: 3 additions & 3 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ chain_verf_LDADD = $(COMMON_LDADD)
clist_LDADD = $(COMMON_LDADD)
cstr_LDADD = $(COMMON_LDADD)
coredefs_LDADD = $(COMMON_LDADD)
ctaes_LDADD = $(COMMON_LDADD) $(top_builddir)/lib/libccoinaes.la
aes_util_LDADD = $(COMMON_LDADD) $(top_builddir)/lib/libccoinaes.la
ctaes_LDADD = $(COMMON_LDADD) $(top_builddir)/lib/libccoinwallet.la
aes_util_LDADD = $(COMMON_LDADD) $(top_builddir)/lib/libccoinwallet.la
crypto_LDADD = $(COMMON_LDADD)
fileio_LDADD = $(COMMON_LDADD)
hash_LDADD = $(COMMON_LDADD)
Expand All @@ -59,5 +59,5 @@ sighash_LDADD = $(COMMON_LDADD)
tx_LDADD = $(COMMON_LDADD)
tx_valid_LDADD = $(COMMON_LDADD)
util_LDADD = $(COMMON_LDADD) $(top_builddir)/lib/libccoinnet.la
wallet_LDADD = $(COMMON_LDADD)
wallet_LDADD = $(COMMON_LDADD) $(top_builddir)/lib/libccoinwallet.la
wallet_basics_LDADD = $(COMMON_LDADD)
2 changes: 1 addition & 1 deletion test/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <ccoin/coredefs.h>
#include <ccoin/cstr.h>
#include <ccoin/key.h>
#include <ccoin/wallet.h>
#include <ccoin/wallet/wallet.h>
#include <ccoin/hdkeys.h>

static bool key_eq(const struct bp_key *key1,
Expand Down