diff --git a/include/ccoin/Makefile.am b/include/ccoin/Makefile.am index e955e88c..23e7d0e1 100644 --- a/include/ccoin/Makefile.am +++ b/include/ccoin/Makefile.am @@ -34,8 +34,7 @@ ccoininclude_HEADERS = \ parr.h \ script.h \ serialize.h \ - util.h \ - wallet.h + util.h ccoinnetincludedir=$(includedir)/ccoin/net @@ -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 + diff --git a/include/ccoin/wallet.h b/include/ccoin/wallet/wallet.h similarity index 86% rename from include/ccoin/wallet.h rename to include/ccoin/wallet/wallet.h index be87c98c..d4e2b473 100644 --- a/include/ccoin/wallet.h +++ b/include/ccoin/wallet/wallet.h @@ -7,10 +7,12 @@ * file COPYING or http://www.opensource.org/licenses/mit-license.php. */ -#include -#include -#include -#include +#include // for cstring +#include // for parr_idx, parr + +#include // for bool +#include // for size_t +#include // for uint32_t #ifdef __cplusplus extern "C" { @@ -71,4 +73,4 @@ extern bool wallet_valid_name(const char *name); } #endif -#endif +#endif /* __LIBCCOIN_WALLET_H__ */ diff --git a/lib/Makefile.am b/lib/Makefile.am index 707c73b7..4e586e08 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -51,10 +51,9 @@ 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 \ @@ -62,6 +61,7 @@ libccoinnet_la_SOURCES= \ 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 diff --git a/lib/wallet.c b/lib/wallet/wallet.c similarity index 91% rename from lib/wallet.c rename to lib/wallet/wallet.c index 3255393c..3f464875 100644 --- a/lib/wallet.c +++ b/lib/wallet/wallet.c @@ -6,19 +6,22 @@ */ #include "picocoin-config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include // for bp_pubkey_get_address +#include // for const_buffer +#include // for chain_info, etc +#include // for hd_extended_key_free, etc +#include // for bp_key_free, bp_key, etc +#include // for mbr_free, mbuf_reader, etc +#include // for p2p_message, etc +#include // for deser_u32, deser_varstr, etc +#include // for ARRAY_SIZE +#include // for wallet, wallet_account, etc + +#include // for assert +#include // for isalnum +#include // for NULL, fprintf, stderr +#include // for free, calloc +#include // for memset, strncmp, strcmp, etc static void account_free(struct wallet_account *acct); diff --git a/src/Makefile.am b/src/Makefile.am index e1238a74..b4e8298e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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@ diff --git a/src/main.c b/src/main.c index 3887b68e..acee53c5 100644 --- a/src/main.c +++ b/src/main.c @@ -20,17 +20,18 @@ #include "wallet.h" // for cur_wallet_addresses, etc +#include // for event_free, event_base_new, etc +#include // for json_decref, json_dumpf, etc + #include #include // for assert #include // for bool #include // for isspace #include // for errno -#include // for event_free, event_base_new, etc #include // for open #include // for fprintf, printf, NULL, etc #include // for free, exit #include // for strcmp, strdup, strlen, etc -#include enum command_type { CMD_CHAIN_SET, @@ -668,4 +669,4 @@ int main (int argc, char *argv[]) free(log_state); return 0; -} +} \ No newline at end of file diff --git a/src/wallet.c b/src/wallet.c index 859a4d38..0e167930 100644 --- a/src/wallet.c +++ b/src/wallet.c @@ -18,7 +18,7 @@ #include // for encode_hex #include // for bp_privkey_get, etc #include // for parr, parr_idx -#include // for wallet, wallet_free, etc +#include // for wallet, ser_wallet, etc #include // for parr_new #include // for json_object_set_new, etc @@ -447,4 +447,3 @@ void cur_wallet_defaultAccount(const char *acct_name) return; } } - diff --git a/src/wallet.h b/src/wallet.h index c897f0a7..8bab2f79 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -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__ */ \ No newline at end of file diff --git a/test/Makefile.am b/test/Makefile.am index 7247128a..3d3d126f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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) @@ -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) diff --git a/test/wallet.c b/test/wallet.c index 3442c8bb..7943fe2e 100644 --- a/test/wallet.c +++ b/test/wallet.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include static bool key_eq(const struct bp_key *key1,