Commit graph

180 commits

Author SHA1 Message Date
Cory Fields 16a58a8644 keys: remove libsecp256k1 verification until it's actually supported
This was added a while ago for testing purposes, but was never intended to be
used. Remove it until upstream libsecp256k1 decides that verification is
stable/ready.
2015-03-02 11:31:43 -05:00
Cory Fields aa3673064c build: remove libstdc++ backwards-compat
Backwards-compatibility for libstdc++ is not limited to straightforward abi
changes. Symbol visibility also needs to be taken into consideration, and
that really can't be addressed simply.

Instead, just static-link libstdc++ for backwards-compat.
2015-02-23 17:56:15 -05:00
Cory Fields 1630219d90 openssl: abstract out OPENSSL_cleanse
This makes it easier for us to replace it if desired, since it's now only in
one spot. Also, it avoids the openssl include from allocators.h, which
essentially forced openssl to be included from every compilation unit.
2015-02-15 11:34:02 -05:00
randy-waterhouse 72ac792b4a Format build flags in src/Makefile.am. 2015-01-30 10:43:30 +13:00
Wladimir J. van der Laan 6b5f5294bb
Merge pull request #5506
7873633 Squashed 'src/secp256k1/' changes from bccaf86..50cc6ab (Pieter Wuille)
1a9576d Use libsecp256k1's RFC6979 implementation (Pieter Wuille)
2015-01-26 13:04:29 +01:00
Wladimir J. van der Laan 204d41a821
Merge pull request #5542
2ecd294 Bugfix: configure: Correctly detect "nothing to build" condition (Luke Dashjr)
b7a4ecc Bugfix: Only check for boost when building code that requires it (Luke Dashjr)
a19eeac Bugfix: configure: Check for openssl/ec.h (Luke Dashjr)
fe925e2 Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code (Cory Fields)
2015-01-08 09:32:36 +01:00
Cory Fields fe925e221f Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code 2015-01-06 20:00:25 +00:00
Pieter Wuille 7268f7b120 Move arith_uint256 out of consensus and util 2015-01-06 00:42:27 +01:00
Pieter Wuille 1a9576de9d Use libsecp256k1's RFC6979 implementation 2015-01-06 00:28:44 +01:00
Wladimir J. van der Laan bfc6070342 uint256->arith_uint256 blob256->uint256
Introduce new opaque implementation of `uint256`, move old
"arithmetic" implementation to `arith_uint256.
2015-01-05 15:45:35 +01:00
Matt Corallo afd4b94b6d Move CMerkleBlock and CPartialMerkleTree to their own file 2014-12-05 01:57:40 -08:00
Luke Dashjr d227011184 MOVEONLY: core/ -> primitives/ 2014-12-03 10:52:58 +00:00
Wladimir J. van der Laan f0877f8b62
Merge pull request #5227
4cdaa95 Resize after succesful result (Pieter Wuille)
9d8604f Header define style cleanups (Pieter Wuille)
a53fd41 Deterministic signing (Pieter Wuille)
3060e36 Add the RFC6979 PRNG (Pieter Wuille)
a8f5087 Add HMAC-SHA256 (Pieter Wuille)
36fa4a7 Split up crypto/sha2 (Pieter Wuille)
2014-12-01 14:57:58 +01:00
Pavel Janík 494f6e7d35 Check for strnlen and provide it if it is not found. 2014-11-24 10:28:24 +01:00
Pieter Wuille 3060e36098 Add the RFC6979 PRNG 2014-11-20 17:22:06 +01:00
Pieter Wuille a8f5087e53 Add HMAC-SHA256 2014-11-20 17:22:06 +01:00
Pieter Wuille 36fa4a78ac Split up crypto/sha2 2014-11-20 17:22:02 +01:00
Cory Fields cdd36c6c5c build: add --with-libs so that libs are optional 2014-11-19 22:31:10 -05:00
Cory Fields 2cf5f16c25 build: add libbitcoinconsensus files and hook up the lib build
Credit BlueMatt for libbitcoinsonsensus.h/cpp
2014-11-19 22:31:10 -05:00
Cory Fields e0077de5de build: make a distinction between static app ldflags and static lib ldflags
For windows builds, exe's are always static, but libs should still conform to
--enabled-shared and --enable-static.
2014-11-19 22:08:27 -05:00
Cory Fields 4300876c81 build: secp256k1 as a subdir, since it's required 2014-11-18 18:06:47 +01:00
Pieter Wuille 07a9901703 Always build and link libsecp256k1 2014-11-18 18:06:46 +01:00
Jeff Garzik 9445b876bd
Merge pull request #2844 2014-11-18 10:17:22 -05:00
Cory Fields ab9edbd6b6 script: create sane error return codes for script validation and remove logging
Attempt to codify the possible error statuses associated with script
validation. script/types.h has been created with the expectation that it will
be part of the public lib interface. The other flag enums will be moved here in
a future commit.

Logging has also been removed in order to drop the dependency on core.h. It can
be re-added to bitcoind as-needed. This makes script verification finally free
of application state and boost!
2014-11-14 16:25:53 -05:00
Jeff Garzik e2655e0ab1 Add unauthenticated HTTP REST interface to public blockchain data. 2014-11-11 04:52:43 -05:00
Pieter Wuille bfe029feeb Reduce bitcoin-tx dependencies 2014-11-06 00:24:41 -08:00
Pieter Wuille 93a6022400 Reduce bitcoin-cli dependencies 2014-11-05 12:47:33 -08:00
Cory Fields d2e74c55bd boost: moveonly: split CPubKey and friends to new files 2014-10-31 01:19:37 -04:00
Cory Fields 900078aeb4 boost: moveonly: create eccryptoverify.h|cpp and move helper functions there
Eventually (after 0.10) these files will hold the logic for crypto
verification routines, and CKey/CPubKey will call into them.
2014-10-31 01:13:07 -04:00
Cory Fields 71697f97d3 Separate protocol versioning from clientversion 2014-10-29 00:24:40 -04:00
Pieter Wuille 723c752636
Merge pull request #5100
99f41b9 MOVEONLY: core.o -> core/block.o (jtimon)
561e9e9 MOVEONLY: Move script/compressor out of script and put CTxOutCompressor (from core) with it (jtimon)
999a2ab MOVEONLY: separate CTxUndo out of core (jtimon)
4a3587d MOVEONLY: Separate CTransaction and dependencies from core (jtimon)
eda3733 MOVEONLY: Move CFeeRate and Amount constants to amount.o (jtimon)
2014-10-28 05:27:41 -07:00
Pieter Wuille 068b7f8ee2
Merge pull request #5118
50f71cd boost: code movement only: split CECKey into separate files (Cory Fields)
bdaec6a boost: remove CPubKey dependency from CECKey. Follow-up of e405aa48 (Cory Fields)
2014-10-27 20:47:32 -07:00
Cory Fields 50f71cd52e boost: code movement only: split CECKey into separate files 2014-10-27 15:00:58 -04:00
jtimon 99f41b9cf7 MOVEONLY: core.o -> core/block.o 2014-10-27 13:54:37 +01:00
jtimon 561e9e9de9 MOVEONLY: Move script/compressor out of script and put CTxOutCompressor (from
core) with it
2014-10-27 13:54:37 +01:00
jtimon 999a2ab41e MOVEONLY: separate CTxUndo out of core 2014-10-27 13:54:37 +01:00
jtimon 4a3587d8db MOVEONLY: Separate CTransaction and dependencies from core 2014-10-27 13:54:37 +01:00
jtimon eda3733091 MOVEONLY: Move CFeeRate and Amount constants to amount.o 2014-10-27 13:54:37 +01:00
jtimon 071473c55c Build util and common before building server 2014-10-27 13:34:25 +01:00
Wladimir J. van der Laan 1bd8a7b2b9
Merge pull request #5086
1723862 build: fix libtool's refusal to link static libs into a dll (Cory Fields)
28d412f build: quit abusing LIBS for Windows builds. (Cory Fields)
2014-10-27 12:28:02 +01:00
Cory Fields fa7361907a boost: split stream classes out of serialize.h
serialization now has no dependencies.
2014-10-22 15:21:06 -04:00
Cory Fields 28d412ff20 build: quit abusing LIBS for Windows builds.
Similar to the INCLUDES changes in 6b099402b4, split out LIBS into individual
entries for more fine-grained control.

Also add MINIUPNPC_LIBS which was missing before, and hook it up to
executables.
2014-10-13 21:21:27 -04:00
Pieter Wuille 5c1e798a8e Make signature cache optional 2014-10-02 20:26:17 +02:00
Wladimir J. van der Laan 3fd192f8b4
Merge pull request #4234
c122f55 qt: Register CAmount metatype (Wladimir J. van der Laan)
a372168 Use a typedef for monetary values (Mark Friedenbach)
2014-10-01 11:28:55 +02:00
Pieter Wuille bf3a5dd7f0
Merge pull request #4796
e8b5f0d Move CBlockIndex, CChain and related code out of main (jtimon)
6db83db Decouple CChain from mapBlockIndex (jtimon)
2014-09-29 06:06:57 +02:00
Mark Friedenbach a372168e77 Use a typedef for monetary values 2014-09-26 15:42:04 -07:00
Philip Kaufmann 611116d4e3 header include cleanup
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-14 12:43:56 +02:00
jtimon c1e433b717 Rename scriptutils.o to wallet_ismine.o 2014-09-10 12:48:35 +02:00
jtimon 0d2fa14a34 Move scriptutils.o to wallet 2014-09-10 12:42:56 +02:00
jtimon e8b5f0d549 Move CBlockIndex, CChain and related code out of main 2014-09-08 22:17:19 +02:00
jtimon e088d65acb Separate script/sign 2014-09-08 20:21:35 +02:00
jtimon 9294a4bbe7 Separate CScriptCompressor 2014-09-08 20:21:35 +02:00
jtimon c4408a6c85 Separate script/standard 2014-09-08 20:21:35 +02:00
jtimon da03e6ed7c Separate script/interpreter 2014-09-08 20:21:33 +02:00
jtimon cbd22a50c4 Move CScript class and dependencies to script/script 2014-09-08 20:19:31 +02:00
jtimon 86dbeea2cd Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes) 2014-09-08 20:19:31 +02:00
Cory Fields 9f7f504efc build: add -DMINIUPNP_STATICLIB for new version
libminiupnpc changed their required static define to the much more sane
"MINIUPNP_STATICLIB". Sadly, they don't respect the old "STATICLIB" for
back-compat. Define them both since the old one didn't seem to be conflicting
anywhere.

Also go ahead and split out the cppflags so that they can be applied only where
they're needed. This will help us to build dll's from our libs without having
their import/export declspecs poisoned.
2014-08-26 15:28:24 -04:00
Wladimir J. van der Laan ad49c256c3 Split up util.cpp/h
Split up util.cpp/h into:

- string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach)
- money utilities (parsesmoney, formatmoney)
- time utilities (gettime*, sleep, format date):
- and the rest (logging, argument parsing, config file parsing)

The latter is basically the environment and OS handling,
and is stripped of all utility functions, so we may want to
rename it to something else than util.cpp/h for clarity (Matt suggested
osinterface).

Breaks dependency of sha256.cpp on all the things pulled in by util.
2014-08-26 13:25:22 +02:00
Wladimir J. van der Laan 691e9d28b5
Merge pull request #4725
e432a5f build: add option for reducing exports (v2) (Cory Fields)
2014-08-19 10:54:35 +02:00
Jeff Garzik 0367329549
Merge branch '2014_univalue_warn' into merge-PR4715
Merge pull request #4715
2014-08-19 00:49:31 -04:00
Cory Fields e432a5f08d build: add option for reducing exports (v2)
This was committed previously as 4975ae172 and reverted, because the flags were
applied even if the checks didn't pass. This is the same commit, fixed up to
actually disable the functionality when necessary.

Enabled automatically if boost >= 1.49.
See: https://svn.boost.org/trac/boost/ticket/2309

Also, check for a default visibility attribute, so that we can mark future
api functions correctly.
2014-08-18 16:10:15 -04:00
Wladimir J. van der Laan fad23a210b
Revert "build: add option for reducing exports"
Revert #4663 for now. It still breaks the pulltester.

This reverts commit 4975ae1722.

Conflicts:
	configure.ac
2014-08-18 16:52:56 +02:00
Jeff Garzik 3cceba7abb Univalue: Do not build JSON escape list at runtime
No need to waste startup time building something that can be done
at compile time.

This also resolves a clang++ warning originally reported in #4714,
univalue/univalue_write.cpp:33:12: warning: array subscript is of type 'char
escapes['"'] = "\\"";
^~~~

etc.
2014-08-18 10:36:21 -04:00
randy-waterhouse c101c76907 build: Add --with-utils (bitcoin-cli and bitcoin-tx, default=yes).
Help string consistency tweaks. Target sanity check fix.
2014-08-17 20:22:12 +12:00
Wladimir J. van der Laan 2eb3c85c9a
Merge pull request #4663
4975ae1 build: add option for reducing exports (Cory Fields)
2014-08-17 09:29:59 +02:00
randy-waterhouse a65668ddc0 build : fix CPPFLAGS for libbitcoin_cli 2014-08-16 10:56:28 +12:00
Cory Fields 4975ae1722 build: add option for reducing exports
Enabled automatically if boost >= 1.49.
See: https://svn.boost.org/trac/boost/ticket/2309

Also, check for a default visibility attribute, so that we can mark future
api functions correctly.
2014-08-15 17:42:53 -04:00
Cory Fields 6b099402b4
build: fix automake warnings about the use of INCLUDES
While we're at it, reduce the use of LIBS as well. This makes dependencies
explicit.

Fixes building with (the not-yet-merged) libsecp256k1 as well.

Github-Pull: #4689
Rebased-By: Wladimir J. van der laan <laanwj@gmail.com>
Rebased-From: 909b347 c0e5dda
2014-08-15 10:42:10 +02:00
Wladimir J. van der Laan a60120e951 Add built-in seeds for .onion
This makes it possible for a node with `-onlynet=tor` to bootstrap
itself.

It also adds the base infrastructure for adding IPv6 seed nodes.

Also represent IPv4 fixed seed addresses in 16-byte format.
2014-08-03 17:26:27 +02:00
Jeff Garzik cbe39a3852 Add "bitcoin-tx" command line utility and supporting modules.
This is a simple utility that provides command line manipulation of
a hex-encoded TX. The utility takes a hex string on the command line
as input, performs zero or more mutations, and outputs a hex string
to standard output.

This utility is also an intentional exercise of the "bitcoin library"
concept. It is designed to require minimal libraries, and works
entirely without need for any RPC or P2P communication.

See "bitcoin-tx --help" for command and options summary.
2014-07-29 11:13:27 -04:00
Jeff Garzik ae775b5b31 Consolidate CTransaction hex encode/decode into core_io.h, core_{read,write}.cpp 2014-07-29 11:13:27 -04:00
Cory Fields 1e72d5c033 build: silence false errors during make clean 2014-07-17 22:03:27 -04:00
Philip Kaufmann 6354935c48 move rand functions from util to new random.h/.cpp 2014-07-09 09:42:19 +02:00
Cory Fields 575e70c0c6 build: fix win32 static linking after libtool merge
Libtool eats the -static flag rather than passing it along to the compiler. To
get the same effect, -all-static is used instead.
2014-07-08 15:53:53 -04:00
Cory Fields 5566826635 secp256k1: Add build-side changes for libsecp256k1
Note: This is added to our existing automake targets rather than as a
libtool-style lib. The switch to libtool-style targets can come later if it
proves to not add any complications.
2014-07-01 12:27:19 -04:00
Pieter Wuille de79aaa7a9 Move non-trivial uint256.h methods to uint256.cpp 2014-06-28 18:02:42 +02:00
Wladimir J. van der Laan 75c82d4923 Move coins.cpp and keystore.cpp to libbitcoin_common
Prepare for introduction of `bitcoin-tx` tool.
2014-06-25 10:31:35 +02:00
Wladimir J. van der Laan 84ce18ca93 Remove unnecessary dependencies for bitcoin-cli
This commit removes all the unnecessary dependencies (key, core,
netbase, sync, ...) from bitcoin-cli.

To do this it shards the chain parameters into BaseParams, which
contains just the RPC port and data directory (as used by utils and
bitcoin-cli) and Params, with the rest.
2014-06-25 10:31:35 +02:00
Wladimir J. van der Laan 14f888ca80 Move network-time related functions to timedata.cpp/h
The network time-offset-mangement functions from util.cpp are moved to
timedata.(cpp|h). This breaks the dependency of util on netbase.
2014-06-25 09:24:50 +02:00
jtimon df852d2bcc Refactor proof of work related functions out of main 2014-06-23 23:10:24 +02:00
Cory Fields f3967bcc50 build: fix build weirdness after 54372482.
bitcoin-config.h moved, but the old file is likely to still exist when
reconfiguring or switching branches. This would've caused files to not rebuild
correctly, and other strange problems.

Make the path explicit so that the old one cannot be found.

Core libs use config/bitcoin-config.h.

Libs (like crypto) which don't want access to bitcoin's headers continue
to use -Iconfig and #include bitcoin-config.h.
2014-06-23 14:04:38 -04:00
Cory Fields 4791b99e2d crypto: create a separate lib for crypto functions
This lib has no dependencies on other bitcoin functionality. Attempting to
use bitcoin headers will result in a failure to compile.
2014-06-21 19:47:43 +02:00
Cory Fields 54372482a8 build: move bitcoin-config.h to its own directory
This allows us to include its path without making other header includes valid.
2014-06-21 19:47:43 +02:00
Pieter Wuille 7ecd9739d9 Move {Read,Write}{LE,BE}{32,64} to common.h and use builtins if possible 2014-06-21 19:47:42 +02:00
Pieter Wuille a5bc9c0917 Add built-in RIPEMD-160 implementation 2014-06-21 19:47:42 +02:00
Pieter Wuille 13b5dfef64 Move crypto implementations to src/crypto/ 2014-06-21 19:47:42 +02:00
Pieter Wuille 1cc344ce42 Add built-in SHA-1 implementation. 2014-06-21 19:47:39 +02:00
Pieter Wuille 977cdadea8 Add a built-in SHA256/SHA512 implementation.
This also moves the HMAC-SHA512 implementation to sha2.cpp.
2014-06-21 19:47:39 +02:00
Cory Fields 679240d0e9 sanity: add libc/stdlib sanity checks
These are meant to test our back-compat stubs, but they are enabled for all
builds for the sake of consistency.
2014-06-16 17:21:34 -04:00
Wladimir J. van der Laan b750cf1fb9
Remove cli functionality from bitcoind
As it says on the tin. It was deprecated in version 0.9, and
at some point it should be removed.

Removes the dependency of bitcoind on libbitcoin-cli.a. Move
some functions that used to be shared but are now only used in
bitcoin-cli.cpp to that file.

After this change, an error is printed (and exit code 1 is returned)
when the user tries to send RPC commands using bitcoind.
2014-06-15 15:38:22 +02:00
Cory Fields efe6888407 build: fix version dependency 2014-06-05 16:05:57 -04:00
Cory Fields f4d81129f0 build: quit abusing AM_CPPFLAGS
Now that the build is non-recursive, adding to AM_CPPFLAGS means adding to
_all_ cppflags.

Logical groups of includes have been added instead, and are used individually
by various targets.
2014-06-05 16:05:57 -04:00
Cory Fields 56c157d5e0 build: avoid the use of top_ and abs_ dir paths
Using them has the side effect of confusing the dependency-tracking logic.
2014-06-05 16:05:57 -04:00
Cory Fields 70c71c50ce build: Tidy up file generation output
- Some file generation was still noisy, silence it.
- AM_V_GEN is used rather than @ so that 'make V=1' works as intended
- Cut down on file copies and moves when using sed, use pipes instead
- Avoid the use of top_ and abs_ dirs where possible
2014-06-05 16:05:57 -04:00
Cory Fields 6b9f0d5554 build: nuke Makefile.include from orbit
Rules and targets no longer need to be shared between subdirectories, so
this is no longer needed.
2014-06-05 16:05:57 -04:00
Cory Fields 65e8ba4dbe build: Switch to non-recursive make
Build logic moves from individual Makefile.am's to include files, which
the main src/Makefile.am includes. This avoids having to manage a gigantic
single Makefile.

TODO: Move the rules from the old Makefile.include to where they actually
belong and nuke the old file.
2014-06-05 16:05:17 -04:00
Pieter Wuille 7cd0af7cc2 Move bignum.h to test/ 2014-05-09 17:56:16 +02:00
Wladimir J. van der Laan bbe53f61db
Merge pull request #4042
05c20a5 build: add symbol for upcoming gcc 4.9's libstdc++ (Cory Fields)
49a3352 gitian-linux: --enable-glibc-back-compat (Warren Togami)
d5aab70 build: add an option for enabling glibc back-compat (Cory Fields)
ffc6b67 build: add glibc/libstdc++ back-compat stubs (Cory Fields)
2014-04-22 16:24:43 +02:00
Pieter Wuille b58be132c9 Replace DecodeBase58/EncodeBase58 with direct implementation.
This removes the bignum/OpenSSL dependency.

The base58 transformation code is also moved to a separate .cpp file.
2014-04-22 09:30:21 +02:00
Cory Fields d5aab70490 build: add an option for enabling glibc back-compat
Using "./configure --enable-glibc-back-compat" will attempt to be
compatible with a target running glibc abi 2.9 and libstdc++ abi 3.4.
2014-04-10 22:28:26 -04:00