Commit graph

162 commits

Author SHA1 Message Date
Pieter Wuille 65751a3cf2 Add CHECKSEQUENCEVERIFY softfork through BIP9 2016-03-18 08:09:06 +00:00
Suhas Daftuar 532cbb22b5 Add testing of ComputeBlockVersion 2016-03-15 16:54:39 +01:00
Pieter Wuille 6851107b3a BIP9 Implementation
Inspired by former implementations by Eric Lombrozo and Rusty Russell, and
based on code by Jorge Timon.
2016-03-15 16:54:38 +01:00
Wladimir J. van der Laan 47c5ed19f3
Merge pull request #7208
64360f1 Make max tip age an option instead of chainparam (Wladimir J. van der Laan)
2016-01-18 11:55:59 +01:00
Wladimir J. van der Laan 605c17844e
Merge pull request #7205
fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke)
fa24439 Bump copyright headers to 2015 (MarcoFalke)
fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
2016-01-05 14:11:40 +01:00
Elias Rohrer e18378e53f Removed offline testnet DNSSeed 'alexykot.me'. 2015-12-15 14:53:15 +01:00
Wladimir J. van der Laan 64360f1304 Make max tip age an option instead of chainparam
After discussion in #7164 I think this is better.

Max tip age was introduced in #5987 to make it possible to run
testnet-in-a-box. But associating this behavior with the testnet chain
is wrong conceptually, as it is not needed in normal usage.
Should aim to make testnet test the software as-is.

Replace it with a (debug) option `-maxtipage`, which can be
specified only in the specific case.
2015-12-14 13:29:28 +01:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
Pieter Wuille eece63fa72 Switch blocks to a constant-space Merkle root/branch algorithm.
This switches the Merkle tree logic for blocks to one that runs in constant (small) space.
The old code is moved to tests, and a new test is added that for various combinations of
block sizes, transaction positions to compute a branch for, and mutations:
 * Verifies that the old code and new code agree for the Merkle root.
 * Verifies that the old code and new code agree for the Merkle branch.
 * Verifies that the computed Merkle branch is valid.
 * Verifies that mutations don't change the Merkle root.
 * Verifies that mutations are correctly detected.
2015-11-27 15:36:52 +01:00
Alex Morcos 33c90cf197 Make skipping BIP30 check chain agnostic 2015-11-02 20:11:55 -05:00
Wladimir J. van der Laan e26a3f6713
Merge pull request #6235
55a8975 Chainparams: Translations: DRY: options and error strings (Jorge Timón)
f3525e2 Chainparams: Replace CBaseChainParams::Network enum with string constants (suggested by Wladimir) (Jorge Timón)
2015-10-20 17:06:28 +02:00
Jorge Timón 55a89751fa Chainparams: Translations: DRY: options and error strings
Also remove SelectBaseParamsFromCommandLine and SelectParamsFromCommandLine
2015-10-20 14:28:43 +02:00
Jorge Timón f3525e24e3 Chainparams: Replace CBaseChainParams::Network enum with string constants (suggested by Wladimir) 2015-10-20 14:22:44 +02:00
Eric Lombrozo 7801f4387d Added fPowNoRetargeting field to Consensus::Params that disables nBits recalculation. 2015-10-19 14:25:21 -04:00
Wladimir J. van der Laan 4899a04c24
Merge pull request #5987
e761d7a Bugfix: Allow mining on top of old tip blocks for testnet (fixes testnet-in-a-box use case) (Luke Dashjr)
2015-10-01 14:11:56 +02:00
Luke Dashjr e761d7a94f Bugfix: Allow mining on top of old tip blocks for testnet (fixes testnet-in-a-box use case) 2015-09-29 19:46:34 +00:00
Pieter Wuille 391dff16fe Do not store Merkle branches in the wallet.
Assume that when a wallet transaction has a valid block hash and transaction position
in it, the transaction is actually there. We're already trusting wallet data in a
much more fundamental way anyway.

To prevent backward compatibility issues, a new record is used for storing the
block locator in the wallet. Old wallets will see a wallet file synchronized up
to the genesis block, and rescan automatically.
2015-09-22 18:51:07 +02:00
Wladimir J. van der Laan e3f13ddc54
Merge pull request #6242
17221bf chainparams: don't use std namespace (Cory Fields)
f0deec5 chainparams: move CCheckpointData into chainparams.h (Cory Fields)
2015-08-20 18:26:26 +02:00
Daniel Kraft 5fb5c9b213 Clean up chainparams some more.
Clean up the code in chainparams a bit more after the recent
refactorings.  In particular, make sure the structure of the "RegTest"
params matches the structure of the other classes.  This makes the code
clearer to read.

Also remove redundant values of the genesis block in always-specified
optional arguments and mark variable/argument as "const".
2015-07-29 21:13:36 +02:00
Cory Fields 17221bf77e chainparams: don't use std namespace 2015-07-28 15:33:33 -04:00
Cory Fields f0deec572b chainparams: move CCheckpointData into chainparams.h
This unties CChainParams from its dependency on checkpoints. Instead, now it
only depends on the raw checkpoint data.
2015-07-28 15:26:50 -04:00
Wladimir J. van der Laan 45d1f5932b
Merge pull request #6381
c4973aa Chainparams: CTestNetParams and CRegTestParams extend directly from CChainParams (Jorge Timón)
d3cf546 Chainparams: Introduce CreateGenesisBlock() static function (Jorge Timón)
2015-07-21 13:29:16 +02:00
Wladimir J. van der Laan 3d9362d5ac
Merge pull request #6398
85ee55b rpc: Remove chain-specific RequireRPCPassword (Wladimir J. van der Laan)
2015-07-13 12:55:06 +02:00
Jorge Timón c4973aaaf6 Chainparams: CTestNetParams and CRegTestParams extend directly from CChainParams
...instead of CMainParams and CTestNetParams respectively

Do the same for CBaseChainParams.
The inheritance was only reducing readibility in this case
2015-07-12 11:13:47 +02:00
Jorge Timón d3cf546ec2 Chainparams: Introduce CreateGenesisBlock() static function 2015-07-12 11:03:06 +02:00
Wladimir J. van der Laan 85ee55b5c3 rpc: Remove chain-specific RequireRPCPassword
I've never liked the chain-specific exception to having to set a
password. It gives issues with #6388 which makes it valid to
set no password in every case (as it enables random cookie authentication).

This pull removes the flag, so that all chains are regarded the same.

It also removes the username==password test, which doesn't provide any
substantial extra security.
2015-07-10 15:01:55 +02:00
Wladimir J. van der Laan 6ebac0782f Remove ChainParams::DefaultMinerThreads
No longer relevant after #5957. This hack existed because of another
hack where the numthreads parameter, on regtest, doubled as how many
blocks to generate.
2015-07-03 16:46:20 +02:00
Mark Friedenbach efd44440d8 Explicitly set tx.nVersion for the genesis block and mining tests
If/when CTransaction::CURRENT_VERSION is incremented, this will break CChainParams and the miner tests. This fix sets the transaction version explicitly where we depend on the hash value (genesis block, proof of work checks).
2015-06-02 16:39:34 -07:00
ayeowch dd9e688b3b Trivial: Corrected owner of DNS seeder 2015-05-14 01:02:00 -04:00
Wladimir J. van der Laan 00820f921d
Merge pull request #6055
a8cdaf5 checkpoints: move the checkpoints enable boolean into main (Cory Fields)
11982d3 checkpoints: Decouple checkpoints from Params (Cory Fields)
6996823 checkpoints: make checkpoints a member of CChainParams (Cory Fields)
9f13a10 checkpoints: store mapCheckpoints in CCheckpointData rather than a pointer (Cory Fields)
2015-05-06 11:38:39 +02:00
Wladimir J. van der Laan 31c0bf1c46
Merge pull request #6080
1a0259f add jonasschnellis dns seeder (Jonas Schnelli)
2015-05-05 18:56:48 +02:00
Wladimir J. van der Laan 00e76db8c2
Merge pull request #6085
b05a89b Non-grammatical language improvements (Luke Dashjr)
7e6d23b Bugfix: Grammar fixes (Corinne Dashjr)
2015-05-04 08:01:58 +02:00
Luke Dashjr b05a89b2de Non-grammatical language improvements 2015-05-02 15:23:59 +00:00
Cory Fields 699682304f checkpoints: make checkpoints a member of CChainParams
This drops the virtual call and simplifies the logic
2015-04-30 23:14:48 -04:00
Cory Fields 9f13a10548 checkpoints: store mapCheckpoints in CCheckpointData rather than a pointer 2015-04-30 23:14:08 -04:00
Jonas Schnelli 1a0259f7f0 add jonasschnellis dns seeder 2015-04-29 16:42:41 +02:00
Cory Fields 739d6155d3 chainparams: use SeedSpec6's rather than CAddress's for fixed seeds
This negates the need for CAddress here at all
2015-04-24 14:32:39 -04:00
mrbandrews f9ec3f0fad Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:

- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
  reasonably be met, with some assumptions about block sizes, orphan rates,
  etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
  mainnet; defined separately for mainnet, testnet, and regtest in chainparams
  as nPruneAfterHeight).

This unsets NODE_NETWORK if pruning is enabled.

Also included is an RPC test for pruning (pruning.py).

Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-04-22 15:53:48 -04:00
Michael Ford 1e3473d384 Add operator names to DNS Seed list 2015-04-20 13:29:23 +02:00
Cory Fields fd311996e8 consensus: don't use arith_uint256 in consensus.h
Requiring arith_uint256 at such a base level is not good for modularity.
2015-04-10 15:33:37 -04:00
Pieter Wuille 3fcfbc8ac5 Add a consistency check for the block chain data structures
This adds a -checkblockindex (defaulting to true for regtest), which occasionally
does a full consistency check for mapBlockIndex, setBlockIndexCandidates, chainActive, and
mapBlocksUnlinked.
2015-03-27 13:38:48 -07:00
Jorge Timón bd006110fb Consensus: Refactor: Introduce Consensus::Params class 2015-03-25 20:39:26 +01:00
Wladimir J. van der Laan 3aa0130b96 test: remove fSkipProofOfWork
Not used, and REGTEST already allows creating blocks at
the lowerst possible difficulty.
2015-03-09 16:09:54 +01:00
Wladimir J. van der Laan 59bd89f116 test: Remove UNITTEST params
UNITTEST parameter are not used by any current tests, and the model
(modifyable parameters) is inconvenient when unit-testing. As
they are stored in a global structure eevery test
would have to (re)set up its own parameters.

For consistency it is also better to test with MAIN parameters.
2015-03-09 16:06:14 +01:00
Cory Fields a2b04ddfe6 build: fix newer boost build with c++11 2015-02-03 22:41:01 -05:00
Wladimir J. van der Laan 729ba31749
Merge pull request #5513
856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields)
9b1ab86 namespace: drop boost::assign altogether here (Cory Fields)
a324199 namespace: remove boost namespace pollution (Cory Fields)
2015-01-06 20:32:45 +01:00
Wladimir J. van der Laan de70dd4904
Merge pull request #5598
eb0d34b Remove unused chainparam networkID (jtimon)
2015-01-06 18:12:58 +01:00
Wladimir J. van der Laan 734f85c4f0 Use arith_uint256 where necessary
Also add conversion from/to uint256 where needed.
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan 34cdc41128 String conversions uint256 -> uint256S
If uint256() constructor takes a string, uint256(0) will become
dangerous when uint256 does not take integers anymore (it will go
through std::string(const char*) making a NULL string, and the explicit
keyword is no help).
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan 4f1524966a Replace direct use of 0 with SetNull and IsNull
Replace x=0 with .SetNull(),
x==0 with IsNull(), x!=0 with !IsNull().
Replace uses of uint256(0) with uint256().
2015-01-05 15:45:34 +01:00
Cory Fields 856e862f4a namespace: drop most boost namespaces and a few header cleanups
A few boost::asio were left around because they're very wordy otherwise.
2015-01-02 15:12:03 -05:00
Gregory Maxwell a094b3d973 Remove bitnodes.io from dnsseeds.
I'm not comfortable with retaining this entry.
2014-12-27 01:38:47 -08:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
jtimon eb0d34b494 Remove unused chainparam networkID 2014-12-11 23:32:30 +01:00
Pavel Janík e0535e15ab Remove misleading comment about testnet's message string. 2014-11-22 22:22:12 +01:00
mruddy 0d91ae308c The first thing that SelectParams does is call SelectBaseParams. Therefore, we do not need to call SelectBaseParams immediately prior to calling SelectParams. 2014-11-04 07:24:47 -05:00
Michael Ford f2e03ffae9 Update comments in chainparams to be doxygen compatible 2014-10-25 17:24:16 +08:00
Wladimir J. van der Laan 7c0f36c431
Clear vFixedSeeds for regtest network
It shouldn't inherit these from testnet.
(seems to be already done for unit test network but forgotten here...)
Fixes #5127.
2014-10-24 09:34:55 +02:00
Wladimir J. van der Laan 25cc1cf8dc
Merge pull request #4981
85c579e script: add a slew of includes all around and drop includes from script.h (Cory Fields)
db8eb54 script: move ToString and ValueString out of the header (Cory Fields)
e9ca428 script: add ToByteVector() for converting anything with begin/end (Cory Fields)
066e2a1 script: move CScriptID to standard.h and add a ctor for creating them from CScripts (Cory Fields)
2014-10-22 12:16:50 +02:00
Cory Fields 85c579e3a6 script: add a slew of includes all around and drop includes from script.h
Lots of files ended up with indirect includes from script.h.
2014-10-17 13:44:57 -04:00
Wladimir J. van der Laan 494ff05a4c Merge pull request #4804 from jtimon/chainparams3
Remove CBaseChainParams::NetworkID()
2014-10-17 08:47:11 +02:00
jtimon ca3ce0fa03 squashme on 3fdb9e8c (Bluematt's bikeshedding) 2014-10-16 22:49:33 +02:00
jtimon b796cb084b SQUASHME: NetworkIdFromCommandLine() function instead of method 2014-10-10 12:05:20 +02:00
jtimon cc97210799 Add fTestnetToBeDeprecatedFieldRPC to CChainParams 2014-10-10 11:01:00 +02:00
jtimon e11712df7e Move checkpoint data selection to chainparams 2014-10-10 11:00:59 +02:00
Wladimir J. van der Laan fbd36d8fb5
Avoid introducing a virtual into CChainParams
Treat fSkipProofOfWorkCheck the same as other parameters.
2014-10-02 13:54:26 +02:00
SergioDemianLerner f0fd00cb77 Switch testing framework from MAIN to new UNITTEST network
UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface
2014-10-02 13:51:39 +02:00
Wladimir J. van der Laan 8d132431b4
Revert merge of pull #4845
It breaks the new mingw tests!

See

- https://travis-ci.org/bitcoin/bitcoin/jobs/36845581
- https://travis-ci.org/bitcoin/bitcoin/jobs/36845582

This reverts commit 4705902777, 5e2e7fcb99, a25fd6be13.
2014-10-02 10:39:55 +02:00
Wladimir J. van der Laan 4705902777 Avoid introducing a virtual into CChainParams
Treat fSkipProofOfWorkCheck the same as other parameters.
2014-09-29 13:13:47 +02:00
SergioDemianLerner 5e2e7fcb99 Suggested corrections on comments, variable names.
Also new test case testing the PoW skip in UNITTEST.
2014-09-29 13:03:23 +02:00
SergioDemianLerner a25fd6be13 Switch testing framework from MAIN to new UNITTEST network
UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface
2014-09-29 13:03:22 +02:00
jtimon 3fdb9e8c15 Remove CBaseChainParams::NetworkID() 2014-09-21 21:25:15 +02:00
Wladimir J. van der Laan f23869e14b
Merge pull request #4623
e84843c Broken addresses on command line no longer trigger testnet. (Ross Nicoll)
2014-09-10 15:07:58 +02:00
Andreas Schildbach 45a4baf100 Add testnet DNS seed of Andreas Schildbach.
It runs sipas crawler, but rather than using its custom nameserver implementation it serves a generated zonefile via bind9. The zone always contains 25 IPv4 and 25 IPv6 peers. FWIW, the zone is secured using DNSSEC.
2014-09-07 11:16:10 +02:00
Matt Corallo 550d4fa7a7 Remove DNS Seeds run by entities which were never well-established. 2014-09-03 00:41:54 -07:00
Ross Nicoll e84843c0db Broken addresses on command line no longer trigger testnet.
When passing a bitcoin: URI on the command line, invalid addresses do not incorrectly send the
user to the test network.
2014-08-30 09:39:59 +01:00
Philip Kaufmann 187115c01d cleanup include of assert.h 2014-08-28 23:02:49 +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
Wladimir J. van der Laan 6513a9f703
Merge pull request #4400
4eedf4f make RandAddSeed() use OPENSSL_cleanse() (Philip Kaufmann)
6354935 move rand functions from util to new random.h/.cpp (Philip Kaufmann)
001a53d add GetRandBytes() as wrapper for RAND_bytes() (Philip Kaufmann)
2014-07-14 11:35:30 +02:00
Wladimir J. van der Laan 52a7d52ffb
Merge pull request #4340
33cc907 Add DNS seed of open-nodes.org (kevin)
2014-07-09 12:00:16 +02:00
Philip Kaufmann 6354935c48 move rand functions from util to new random.h/.cpp 2014-07-09 09:42:19 +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
jtimon fd704c7b2c move pow constants to chainparams 2014-06-23 23:10:24 +02:00
Pieter Wuille 4949004d68 Add CMutableTransaction and make CTransaction immutable.
In addition, introduce a cached hash inside CTransaction, to prevent
recalculating it over and over again.
2014-06-21 22:59:03 +02:00
jtimon b82b7ec3dc Get rid of Params().RPCisTestNet() 2014-06-17 13:08:25 +02:00
Wladimir J. van der Laan 09eb201b1b Remove using namespace std from header file
It's considered bad form to import things into the global namespace in a
header. Put it in the cpp files where it is needed instead.
2014-06-16 17:42:54 +02:00
kevin 33cc907dfb Add DNS seed of open-nodes.org 2014-06-15 15:35:53 +08:00
Philip Kaufmann f5ae6c9826 add NetworkIDString() to chainparams
- returns the BIP70 network string
- use that new function in the core and GUI code and remove unused code
  and functions
2014-06-12 13:19:12 +02:00
Andreas Schildbach c30329adfa Add testnet DNS seed of Alex Kotenko. 2014-06-12 00:36:53 +02:00
jtimon c8c52de3a0 Replace virtual methods with static attributes, chainparams.h depends on
protocol.h instead of the other way around
2014-06-04 13:29:36 +02:00
jtimon 6fc0fa63d9 Add RPCisTestNet chain parameter 2014-06-04 13:29:36 +02:00
jtimon cfeb8235fd Add RequireStandard chain parameter 2014-06-04 13:29:36 +02:00
jtimon 21913a9ac9 Add AllowMinDifficultyBlocks chain parameter 2014-06-04 13:29:36 +02:00
jtimon d754f34e8d Move majority constants to chainparams 2014-06-04 13:29:36 +02:00
jtimon cb9bd83bba Add DefaultCheckMemPool chain parameter 2014-06-04 13:29:35 +02:00
jtimon 2595b9ac23 Add DefaultMinerThreads chain parameter 2014-06-04 13:29:35 +02:00
jtimon bfa9a1a638 Add MineBlocksOnDemand chain parameter 2014-06-04 13:29:35 +02:00
jtimon 1712adbe0b Add MiningRequiresPeers chain parameter 2014-06-04 13:29:35 +02:00
Pieter Wuille df9eb5e14f Move {Get,Set}Compact from bignum to uint256 2014-05-09 16:44:59 +02:00
Cory Fields 4f497cd97d script: switch outside users to CScriptNum 2014-04-22 00:32:30 -04:00