5811 Commits

Author SHA1 Message Date
Ross Nicoll
a5b7abf8a6 Merge pull request #1231 from patricklodder/1.10-majority-v2-constraints
Re-enable SuperMajority triggered activation for v2 block constraints
2015-08-10 20:24:39 +01:00
Patrick Lodder
c3a4a0574e Enable block constraints properly
BIP16 and BIP30 have both been enabled on Dogecoin since inception
and should not be conditional.
2015-08-10 15:55:45 +02:00
Patrick Lodder
2d332d242a Re-enable SuperMajority triggered activation for v2 block constraints
Start validating v2 blocks when there is a v3 supermajority, because
v2 clients (1.5->1.8) had supermajority checks disabled.

This is needed for future-proofing, so that a currently accepted,
but invalid v2 block will also be accepted on newer nodes.
2015-08-10 10:54:28 +02:00
Ross Nicoll
8841214bdc Replace print icon with Typeicons equivalent 2015-08-07 22:16:51 +01:00
Andymeows
a245210cbe Add paper wallet generator to QT wallet 2015-08-07 22:16:51 +01:00
Patrick Lodder
c15e5cebc6 Merge pull request #1227 from kaykurokawa/1.10-dev
changing CAmount (is a int64_t) to arith_uint256 for nTotalAmount
2015-08-07 11:45:02 +02:00
Max K.
3b7279e96d Merge pull request #1220 from rnicoll/1.10-paymentprotocol
Revised payment request handling to use genesis block hash
2015-08-06 22:14:47 +02:00
Ross Nicoll
b61e01d785
Revised payment request handling to use genesis block hash instead of network name
Revised payment request handling to use genesis block hash instead of network name, enabling
support for more networks that just Bitcoin main and test net.
2015-08-06 20:03:00 +01:00
ukurokawa
cf46c981a4 changing CAmount (is a int64_t) to arith_uint256 for nTotalAmount in CCoinsStats to prevent overflow 2015-08-04 18:03:07 -04:00
Ross Nicoll
85e166b504
Update time-based constants
This updated various time-based constants to more closely reflect values
appropriate to Dogecoin:

* Number of blocks to look back for BIP 66 enforcement is doubled on
main net (to about a day and a half's worth, vs 5 days on Bitcoin),
and raised to 1,000 on testnet (bringing it up to the same quantity
as Bitcoin testnet).
* BIP 66 enforcement cut-offs are scaled up appropriate.
* Minimum number of blocks and blockchain size are increased for
pruning. In comparison to Bitcoin this uses 24 hours as a minimum,
rather than 48, although given blocks are rarely full this likely
reflects a lot longer in reality.
2015-08-04 22:32:01 +01:00
langerhans
b240f79b74 Set regtest coinbase maturity for easier maths in RPC tests 2015-08-01 19:29:20 +02:00
Max K.
f30f9dddd0 Merge pull request #1217 from rnicoll/1.10-checkpoints-seeds
Update checkpoints
2015-08-01 17:22:05 +02:00
Ross Nicoll
d988dc7ba0 Merge pull request #1213 from langerhans/1.10-dev-maturity
Minor fixes to concensus relevant parameters
2015-07-31 20:45:56 +01:00
langerhans
38a83007e8 Move COINBASE_MATURITY to the consensus parameters 2015-07-31 21:29:43 +02:00
langerhans
9b58d319f3 Make RegTest use simplified rewards for easier test vector setup and use short block times 2015-07-31 20:17:15 +02:00
Max K.
faaa412717 Merge pull request #1204 from rnicoll/1.10-fees
Add Dogecoin current fee calculation logic
2015-07-31 20:16:46 +02:00
Ross Nicoll
c81d7632e9 Add Dogecoin current fee calculation logic
Introduces 1 COIN/kb fees, rounded up to the next 1 COIN.
Disable free transactions
Dust outputs incur a 1 COIN additional fee
Add unit tests for fee calculation
Update existing unit tests with higher transaction values so that transactions are still standard
2015-07-31 18:11:06 +00:00
Ross Nicoll
d62c7aa09c Update checkpoints 2015-07-30 19:52:49 +00:00
Ross Nicoll
3207dbf728 Add chain height when fetching consensus parameters in initialization
Add chain height when fetching consensus parameters in initialization,
this code was missed in the first patch as it was disabled at the time.
2015-07-30 19:29:39 +00:00
Max K.
2bb124df3f Merge pull request #1207 from rnicoll/1.10-bitcoin
Bring client up to date with Bitcoin Core 0.11.0
2015-07-30 20:37:58 +02:00
Max K.
11b10408d0 Merge pull request #1206 from rnicoll/1.10-txdb
Add Scrypt hash and AuxPoW header to index database
2015-07-30 20:33:39 +02:00
Suhas Daftuar
fc1f115ee5 Advance pindexLastCommonBlock for blocks in chainActive
This prevents an edge case where a block downloaded and pruned
in-between successive calls to FindNextBlocksToDownload could
cause the block to be unnecessarily re-requested.

Github-Pull: #6233
Rebased-From: 3e9143386a90e508c8d41719294db11264f5f0a0
2015-07-29 18:29:30 +01:00
Philip Kaufmann
a46370f791 fix crash on shutdown when e.g. changing -txindex and abort action
- fixes #3136
- the problem is related to Boost path and a static initialized internal
  pointer
- using a std::string in CDBEnv::EnvShutdown() prevents the problem
- this removes the boost::filesystem::path path field from CDBEnv

Github-Pull: #6282
Rebased-From: 0ce30eaa36295447c6e7f8d16a05798c746fe28a
2015-07-29 18:29:30 +01:00
Andriy Voskoboinyk
e44aaef534 Add an alternate location of endian.h header
Github-Pull: #6246
Rebased-From: 0640a5eb60b06de61f873fd88ae0252f5a11c339
2015-07-29 18:29:30 +01:00
Wladimir J. van der Laan
c09dfd06fc Revert "Disable partition check for now, it triggers too often (issue #6251)"
Re-enable partition check, it should be safe again after #6256.

This reverts commit 3eada74d6f4720e650c67461c04c3aafdeaff21e.
2015-07-29 18:29:30 +01:00
Max K.
433f0fd670 Merge pull request #1208 from rnicoll/1.10-simplified-rewards
Remove hard coded switch on whether simplified rewards are used.
2015-07-29 19:29:24 +02:00
Ross Nicoll
20278f5f5f Minor AuxPoW fixes
Replaced references to Namecoin with Dogecoin
Set chain ID when constructing a new block to be mined
Added assignment overload so that assigning one BlockVersion to another does a full copy.
2015-07-28 18:24:27 +00:00
Ross Nicoll
5224edba34
Remove hard coded switch on whether simplified rewards are used. 2015-07-27 23:07:40 +01:00
Ross Nicoll
35ed1cfce1 Add Scrypt hash and AuxPoW header to index database
Add Scrypt hash and AuxPoW header to index database so that index can be validated
(a check that both Litecoin and Namecoin disable for simplicity). The index format
is incompatible with 1.8, as a result, however, and guidelines on performing the
upgrade will need to be prepared.

Given scope of the change, it may be advisable for services to prepare bootstrap files and destroy existing index databases entirely before reindexing. To discuss.
2015-07-26 20:07:48 +00:00
Ross Nicoll
d97a37f4a9 Use block height 0 when checking for genesis block
There is no previous block when validating the genesis block as part of contextual checks,
so block height cannot be used. Consensus parameters are now taken from height 0 for
the genesis check, and from block height only if the it's not the genesis block.
2015-07-26 12:25:03 +00:00
Ross Nicoll
77ec26804d Update Python test address and key values to match Dogecoin format. 2015-07-19 16:42:23 +00:00
Ross Nicoll
f94966f41a Disable payment protocol very large value test, as it's impossible to exceed maximum Dogecoin in a payment request. 2015-07-19 16:42:23 +00:00
coblee
106ecab0e0 Litecoin: Fix zeitgeist2 attack thanks to Lolcust and ArtForz. This fixes an issue where a 51% attack can change difficulty at will. Go back the full period unless it's the first retarget after genesis. 2015-07-19 16:42:23 +00:00
Ross Nicoll
8d52844229 Minor Dogecoin consensus fixes
Updated maximum coins to match Dogecoin.
Updated protocol version to disable connections to pre-AuxPoW clients.
Disable version 2 block requirement
Update coinbase maturity to match Dogecoin
2015-07-19 16:42:23 +00:00
Ross Nicoll
949b1ccd88 Modify chain consensus parameters to be height aware 2015-07-19 16:42:22 +00:00
Ross Nicoll
c453bcc9e5 Adapt AuxPoW to Dogecoin
Changed AuxPoW parent block hashing to use Scrypt rather than SHA256 hash.
Update chain parameters to match Dogecoin
Move CheckProofOfWork into dogecoin.cpp and rename it to CheckAuxPowProofOfWork.
Add operator overrides to CBlockVersion so that naive usage operates on the underlying version without chain ID or flags.
Modify RPC mining to more closely match existing submitblock() structure
2015-07-10 20:23:14 +01:00
Daniel Kraft
eabf633f13 Merge AuxPoW support from Namecore
Includes the following commits:

commit 2ea1b5cd8cf2bdd08e43ae39fb76352eebe14895
commit f2a8220c34275f022f02d81e9e84d4cec33bd51c
commit 84b8b56113e6057b0253475b83e797dc1fed2eed
commit 8471d5db221f145f5a40022ed1897c1b996b628e
commit 2f125ad0a67e1b8f71b18a14a3b41d7e577391d1
commit e01dbc3608703b4cb4e9882738125f2b7816cdb8
commit f0421312631cd44669f9f84d339a0c470b4423b9
commit 1fd522db5dfddfd0e1b0c794b82fae2cc7bdb099
commit 71f63ad99f70ff6461c795fd728aea16aa1008f8
commit a7c44d98a8ded4df0e8455c4c5629b1a5b303bbf
commit e1d7b4fc15addf3dfeb3853fa66230a8bdacd75f
commit d016f2fa02572fd340129176b942b3f19bd5260b
commit f4716e5a168a697afce854a37350fdae0988bdd8
commit 03a575e3b13bf06cbb0a007d6672b05d2085c26e
commit d7ea37444bd9e9ac461a3dda0b16afefd160b062
commit db22affa01e050ff847a12e20c83b88952d80b59
commit 9b7e14986655f914b2d0903ca1d79367c92c6c7e
commit e21034f9c124893d5b9631e9ca231b0b9ede3d52

Changes are as below:

Wrap CBlockHeader::nVersion into a new class (CBlockVersion).  This allows to take care of interpreting the field into a base version, auxpow flag and the chain ID.

Update getauxblock.py for new 'generate' RPC call.

Add 'auxpow' to block JSON.

Accept auxpow as PoW verification.

Add unit tests for auxpow verification.

Add check for memory-layout of CBlockVersion.

Weaken auxpow chain ID checks for the testnet.

Allow Params() to overrule when to check the auxpow chain ID and for legacy blocks.  Use this to disable the checks on testnet.

Introduce CPureBlockHeader.

Split the block header part that is used by auxpow and the "real" block header (that uses auxpow) to resolve the cyclic dependency between the two.

Differentiate between uint256 and arith_uint256.

This change was done upstream, modify the auxpow code.

Add missing lock in auxpow_tests.

Fix REST header check for auxpow headers.

Those can be longer, thus take that into account.  Also perform the check actually on an auxpow header.

Correctly set the coinbase for getauxblock results.

Call IncrementExtraNonce in getauxblock so that the coinbase is actually initialised with the stuff it should be.  (BIP30 block height and COINBASE_FLAGS.)

Implement getauxblock plus regression test.

Turn auxpow test into FIXTURE test.

This allows using of the Params() calls.

Move CMerkleTx code to auxpow.cpp.

Otherwise we get linker errors when building without wallet.

Fix rebase with BIP66.

Update the code to handle BIP66's nVersion=3.

Enforce that auxpow parent blocks have no auxpow block version.

This is for compatibility with namecoind.  See also https://github.com/namecoin/namecoin/pull/199.

Move auxpow-related parameters to Consensus::Params.
2015-07-05 18:45:24 +01:00
Patrick Lodder
8733540186 [tests] fix partition alerts for Dogecoin
Partitioning is tested over 4h and 100 blocks are insufficient
to test this for Dogecoin. We need 640 blocks in 4h for the
"abnormally high" alert test, I've found a set of 800 blocks to
test over providing sufficient margin.
2015-07-05 16:37:11 +02:00
Ross Nicoll
3de28f1f9d
Further unit test corrections
Replace RPC and deterministic signatures in unit tests with Dogecoin values. While
conventionally I'd use an alternative implementation for these, as RFC 6979
compliant signature generation isn't terribly common, and there's no reason
to suspect we've modified this code, I'm going to assert that it's good enough
to test that the code doesn't provide different values.

Correct BIP32 key headers for Dogecoin, also by repacking the data.

Disabled Bitcoin PoW tests, but left code in place to simplify later merges. These are
replaced by the Dogecoin PoW tests.
2015-07-05 09:06:51 +01:00
Patrick Lodder
dcea4af668 [tests] use dogecoin fixtures pt1
uses our test fixtures for:
- alerts
- base58
- keys
- main
- miner
2015-07-03 23:17:31 +02:00
Ross Nicoll
8da45ed40b
Added Digishield support and unit tests 2015-06-28 22:10:58 +01:00
Ross Nicoll
2468489d4e Add Dogecoin block subsidy calculations. 2015-06-28 18:04:45 +01:00
Ross Nicoll
a99e717ed6 Added Scrypt mining support based on Dogecoin 1.9 work. 2015-06-28 16:21:09 +00:00
Warren Togami
8a7d5338c2 Litecoin: Scrypt n=1024 Pow hash based upon Colin Percival's Tarnsnap (2009)
Modified by Artforz, coblee, pooler, wtogami, Nikolay Belikov, Adrian Gallagher

miner.cpp changes stripped during merge to Dogecoin
2015-06-28 16:21:02 +00:00
Patrick Lodder
5f769e00cf port dogecoin base chainparams 2015-06-27 22:18:25 +02:00
Cory Fields
ef1d506054
Fix scheduler build with some boost versions.
Some boost versions have a conflicting overload of wait_until that returns void.
Explicitly use a template here to avoid hitting that overload.

Github-Pull: #6285
Rebased-From: 72bf90d770ce5b2653fd482928646cd6a9f5f6d7
2015-06-16 13:57:21 +02:00
Wladimir J. van der Laan
2617b75e15
translation update pre-rc2 2015-06-15 18:02:26 +02:00
Gavin Andresen
fce474c9df
Use best header chain timestamps to detect partitioning
The partition checking code was using chainActive timestamps
to detect partitioning; with headers-first syncing, it should use
(and with this pull request, does use) pIndexBestHeader timestamps.

Fixes issue #6251

Github-Pull: #6256
Rebased-From: 65b94545036ae6e38e79e9c7166a3ba1ddb83f66
2015-06-15 10:34:07 +02:00
Wladimir J. van der Laan
4d9c7fe61d
Add option -alerts to opt out of alert system
Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of #6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.

Github-Pull: #6274
Rebased-From: 02a6702a82a5b00e0e0351041dd3267308b7f319
2015-06-15 09:58:05 +02:00
Tom Harding
c9fd9078ce
Fix getbalance *
Chance "getbalance *" not to use IsTrusted.  The method and result
now match the "getbalance <specific-account>" behavior. In
particular, "getbalance * 0" now works.

Also fixed a comment -- GetGalance has required 1 confirmation
for many years, and the default "getbalance *" behavior matches
that.

Github-Pull: #6276
Rebased-From: 7d6a85ab5b1dc96e0f3f6f835f27bb81ba2af919
2015-06-15 09:03:25 +02:00