Commit graph

13220 commits

Author SHA1 Message Date
Ross Nicoll 57dae15a77 Replace HMAC_SHA256 with Bitcoin's version (#1438) 2018-09-19 22:11:47 +01:00
Ross Nicoll 5618d8497a Update payment protocol to match Dogecoin (#1433)
* 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.
* Disable payment protocol certificate unit tests; we don't modify this code, and regenerating the test data is likely to be significantly time consuming. Will re-enable once discussion on spec is concluded.
2018-09-19 22:11:47 +01:00
Ross Nicoll ea52cb3ae0 Add block height to block notification substitution options (#1430) 2018-09-19 22:11:47 +01:00
Ross Nicoll 2860c4bc31 Enforce minor Dogecoin parameters (#1427)
* 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.
* Multiply fork detection parameters by 5. The wall clock time elapsed for "long" forks is therefore half that of Bitcoin, but IMHO those figures are excessive for a chain with 1 minute block times.
* BIP16 and BIP30 have both been enabled on Dogecoin since inception and should not be conditional.
2018-09-19 22:11:47 +01:00
Ross Nicoll ad9e54ca72 Update test cases at 1000-byte boundaries (#1439)
Update test cases for 1,000 byte TX boundaries; in 1.10 and before the fees for these were rolled up to the next DOGE, however that results in incorrect fees because the UI currently uses 1,000 bytes as a predicted size. This updates the tests to match new behaviour in 1.14.
2018-09-19 22:11:41 +01:00
Ross Nicoll 3c060b31fe Load AuxPoW blocks from index correctly (#1443)
Load AuxPoW blocks from index correctly, by setting the version on the block before trying to check if it's AuxPoW. Previously the AuxPoW part of the block was never loaded because the check always failed.
2018-09-19 21:09:16 +01:00
Ross Nicoll 4d5e53e7b2 Initialise left/right consensus branches to null (#1435)
Strictly speaking the left/right consensus branches haven't been initialised so contain random values.
Most of the time these happen to be null, but sometimes causes client crashes (at least it does in 1.15, but fixing in earlier versions to be sure).
2018-09-19 21:09:16 +01:00
Ross Nicoll 3d363eccd4 Bring 1.14 fees in line with 1.10 (#1425)
* Disable free transactions
* Updating remaining fee calculation constants
* Round up to the nearest 1k, not up 1k so the UI fee estimator is correct
2018-09-19 21:09:16 +01:00
Ross Nicoll 493f02ba2a Always use parameters at block 0 to get genesis block hash (#1416)
This doesn't actually change behaviour, but stylistically is more correct.
2018-09-19 21:09:16 +01:00
Patrick Lodder 33db4921e5 [auxpow] Guarantee backward compatibility on getauxblock
Adds a wrapper around getauxblock to return boolean responses
for getauxblock rather than bip22 responses.
2018-09-19 21:09:16 +01:00
Ross Nicoll 4b33236028 Change result from getauxblock to BIP22 validation state 2018-09-19 21:09:16 +01:00
Ross Nicoll 7b81f4de0a Move COINBASE_MATURITY to the consensus parameters (#1426) 2018-09-19 21:09:16 +01:00
Ross Nicoll ec40df46b5 Check only the base block version (#1411)
Check only the base block version when looking for unexpected version numbers
2018-09-19 21:09:16 +01:00
Ross Nicoll 18850d359b Add Dogecoin current fee calculation logic (#1413)
Introduces 1 COIN/kb fees, rounded up to the next 1 COIN.
2018-09-19 21:09:16 +01:00
Lola Dam 65342fa48f Verify when doing 'backupwallet' that destination is not the same path of the original wallet.dat file. (#1406) 2018-09-19 19:24:06 +01:00
Ross Nicoll 277f207457 Update dogecoin-tx tests (#1409)
Update Python test address and key values to match Dogecoin format
2018-09-19 19:24:06 +01:00
Ross Nicoll c6eeab75a1 Change count type used by gettxoutsetinfo (#1415)
changing CAmount (is a int64_t) to arith_uint256 for nTotalAmount in CCoinsStats to prevent overflow
2018-09-19 19:24:06 +01:00
Ross Nicoll 7d647782dd Update checkpoints and chain work (#1410)
* Update checkpoints and chain work

* Correct checkpoint syntax

* Correct timestamp of last checkpoint block
2018-09-19 19:24:06 +01:00
Max K 60f8ff05e4 Fix 1.14 unit tests (#1408)
* Fix BlockEncodings test by setting a legacy block version

* Fix RPC test by adding missing RPC call

* Add missing regtest genesis hashes
2018-09-19 19:24:06 +01:00
Ross Nicoll 1be681a1b9 Modify chain consensus parameters to be height aware (#1396)
* Modify chain consensus parameters to be height aware
* Correct implementation of simplified rewards in parameters
* Correct max money
* Use base block version in IsSuperMajority() instead of full version
* Correct mining of blocks in AuxPoW tests
* Add in missing pre-AuxPoW consensus checks
2018-09-19 19:24:06 +01:00
Ross Nicoll a89d54c4b2 Change BIP65/66 enforcement to match Dogecoin (#1403)
* Introduce first estimates at BIP lock-in blocks

* Introduce Dogecoin BIP parameters

* Re-introduce supermajority rules for BIP65

* Add BIP65 supermajority rules

* Tighten v3 block constraints

* Don't enforce coinbase in v2 blocks

* Correct testnet majority params

* Change to using base version when checking supermajority
2018-09-19 19:23:29 +01:00
Ross Nicoll 92054123b8 Set SegWit timeout to zero to disable it (#1405) 2018-09-19 19:23:29 +01:00
Ross Nicoll 5833455f74 Stop sending a Bitcoin alert to Dogecoin clients 2018-09-19 19:23:29 +01:00
Ross Nicoll e9c0ac7afb Handle legacy v2 block at #66064 2018-09-19 19:23:29 +01:00
Ross Nicoll 0a403a2227 Correct PoW calculation logic to use locally calcualted difficulty 2018-09-19 19:23:29 +01:00
Ross Nicoll 1de15c70ce Sync changes from Dogecoin 1.10 2018-09-19 19:23:29 +01:00
Ross Nicoll fcde864334 Sync mining code from Namecore to resolve unit test failures (#1385) 2018-09-19 19:23:29 +01:00
Ross Nicoll bc8cca4896 Merge AuxPoW support from Namecore
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.
2018-09-19 19:22:45 +01:00
Ross Nicoll d2feb2e6fb Update DB version to 5.1 2018-09-19 19:22:44 +01:00
langerhans bec95b0cf2 Update dependency builder and its packages to be ready for Dogecoin specifics 2018-09-19 19:21:49 +01:00
Ross Nicoll 42aa48ea69 Annotate work to be done to Dogecoin-ify 2018-09-19 19:21:49 +01:00
Ross Nicoll f0f9fd0292 Add Dogecoin difficulty calculations 2018-09-19 19:21:49 +01:00
coblee 8279f81b44 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. 2018-09-19 19:21:49 +01:00
Warren Togami b506efbe74 Litecoin: Scrypt n=1024 Pow hash based upon Colin Percival's Tarnsnap (2009) Modified by Artforz, coblee, pooler, wtogami, Nikolay Belikov, Adrian Gallagher 2018-09-19 19:21:49 +01:00
Ross Nicoll 3cff8e9773 Replace test data with Dogecoin values
Replace test data with Dogecoin equivalents in the folowing tests:

* base58
* bip32
* keys
* miner
* pow

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.

Disabled Bitcoin PoW tests, but left code in place to simplify later merges. These are
replaced by the Dogecoin PoW tests.
2018-09-19 19:21:49 +01:00
Ross Nicoll 8c0468c2d2 Add Dogecoin block subsidy calculations. 2018-09-19 19:21:49 +01:00
Ross Nicoll 64af132fdb Replace consensus values with Dogecoin equivalents
* Replace chain parameters with Dogecoin values
* Update maximum coins to match Dogecoin
* Disable version 2 block requirement
* Update coinbase maturity to match Dogecoin
2018-09-19 19:21:48 +01:00
Ross Nicoll ccca58b9e0 Update DB version to 5.1 2018-09-19 19:21:48 +01:00
Suhas Daftuar 52965fbaef
Fix crash bug with duplicate inputs within a transaction
Introduced by #9049

Github-Pull: #14247

Tree-SHA512: 54ccf896e4c816ba8532644affc984a091ed801d8387bb01a836953c9ec4a345359d98fb58dd5f929617afd42bce0cc40293fecf943a1584207c82dd78da0ea5
2018-09-18 13:05:49 +02:00
MarcoFalke b9ca77863b
Merge #11296: [0.14] travis: filter out pyenv (Cory Fields)
a4a0adbc7 travis: filter out pyenv (Cory Fields)

Pull request description:

  This fixes the travis issues on the 0.14 branch

Tree-SHA512: 302495d9d5eb554e32e6aa3a788416395d8efeaee153dc2ad9425e2762ac83e36a0a5f128d16098147e95d610dd2fbc7aae70e39a11f54ed421abd38693378d5
2017-09-10 18:29:30 +02:00
Cory Fields a4a0adbc70 travis: filter out pyenv
Github-Pull: #11271
Rebased-From: aa2e0f09ec
2017-09-10 04:52:47 +02:00
Wladimir J. van der Laan 91be5e3c1e
Merge #10516: Backports for 0.14.3
ff274d3 [doc] Add hint about getmempoolentry to getrawmempool help. (Karl-Johan Alm)
76f9cf9 contrib: Update location of seeds.txt (Wladimir J. van der Laan)
12adedf Trivial: remove extra character from comment (CryptAxe)
d2ec969 Fixed typo in documentation for merkleblock.h (Mikerah)
3612219 contrib/init/bitcoind.openrcconf: Don't disable wallet by default (Luke Dashjr)
692dbb0 [doc] Minor corrections to osx dependencies (fanquake)
87a21d5 Fix: make CCoinsViewDbCursor::Seek work for missing keys (Pieter Wuille)
28b8b8b [wallet] Securely erase potentially sensitive keys/values (Thomas Snider)
ff13f59 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm)
e23cef0 Fix some empty vector references (Pieter Wuille)
6ad45b8 Re-enable upnp support in contrib/debian (Matt Corallo)
e9a0d89 Build with QT5 on Debian-based systems using contrib/debian (Matt Corallo)
2ea0358 Bump minimum boost version in contrib/debian (Matt Corallo)
c94e262 Update contrib/debian to latest Ubuntu PPA upload. (Matt Corallo)
96c7f2c Add CheckQueue Tests (Jeremy Rubin)
e207342 Fix CCheckQueue IsIdle (potential) race condition and remove dangerous constructors. (Jeremy Rubin)
ef810c4 [trivial] Fix a typo (introduced two days ago) in the default fee warning (practicalswift)
7abe7bb Qt/Send: Give fallback fee a reasonable indent (Luke Dashjr)
3e4d7bf Qt/Send: Figure a decent warning colour from theme (Luke Dashjr)
c5adf8f [Qt] Show more significant warning if we fall back to the default fee (Jonas Schnelli)
ee1a60d [tests] update disconnect_ban.py test case to work with listbanned (John Newbery)
d289b56 [net] listbanned RPC and QT should show correct banned subnets (John Newbery)
0422693 [tests] disconnect_ban: remove dependency on urllib (John Newbery)
98bd0c3 [tests] disconnect_ban: use wait_until instead of sleep (John Newbery)
bfd1cf6 [tests] disconnectban test - only use two nodes (John Newbery)
5bc75bb [tests] fix nodehandling.py flake8 warnings (John Newbery)
c25d0a8 Update release notes to include RPC error code changes. (John Newbery)
f5efe82 Return correct error codes in fundrawtransaction(). (John Newbery)
4943d7a Return correct error codes in setban(). (John Newbery)
18c109d Return correct error codes in removeprunedfunds(). (John Newbery)
fe51c89 Return correct error codes in blockchain.cpp. (John Newbery)
3ad00b4 Return correct error codes in bumpfee(). (John Newbery)
71463a7 [qa] Test prioritise_transaction / getblocktemplate interaction (Suhas Daftuar)
d28d583 Bugfix: PrioritiseTransaction updates the mempool tx counter (Suhas Daftuar)

Tree-SHA512: fa3628527c8e176e438de992b9c5815cc2f3c296dbe5d81b592d17a907554e9c6af7eb595e96a2c345de399ba5326c07b4791a91b7b07f89dce0787c85891206
2017-07-06 18:57:00 +02:00
Wladimir J. van der Laan fc61c8322b
Merge #10588: doc: Note preexisting bug in display of fee calculation in coin control
60b967e Note preexisting bug in display of fee calculation in coin control (Alex Morcos)

Tree-SHA512: 0179654d313ea10b776781617cea744757344d8b4455153540f116978a72aabdc0a3092388b9cfbe8d0348b699943a9e41082ed964e161e4f3017dcd056e77fc
2017-06-15 12:44:01 +02:00
Alex Morcos 60b967ec41 Note preexisting bug in display of fee calculation in coin control 2017-06-14 14:34:29 -04:00
Wladimir J. van der Laan 7a643511b4
doc: Fill in details about miniupnp CVE-2017-8798 2017-06-07 13:06:11 +02:00
Wladimir J. van der Laan 5e408d99a2
doc: Update manpages for 0.14.2 2017-06-06 16:26:56 +02:00
Wladimir J. van der Laan cc23438af0
qt: 0.14.2 pre-rc2 translations update 2017-06-06 15:06:16 +02:00
Karl-Johan Alm ff274d3b00 [doc] Add hint about getmempoolentry to getrawmempool help.
Github-Pull: #10310
Rebased-From: 3a0a5bc234
2017-06-05 22:58:53 +00:00
Wladimir J. van der Laan 76f9cf9ac9 contrib: Update location of seeds.txt
Update the steps for updating the hardcoded seed nodes to point to the
new filename on @sipa's server, and add command to decompress it.

Ref: #10163

Github-Pull: #10495
Rebased-From: ac9cd953d9
2017-06-05 22:58:53 +00:00
CryptAxe 12adedff0b Trivial: remove extra character from comment
Github-Pull: #10309
Rebased-From: 3503716f1e
2017-06-05 22:58:53 +00:00