Commit graph

6448 commits

Author SHA1 Message Date
Jorge Timón c53d48a6b3 BIP70: Chainparams: DRY: Make qt/guiutil.cpp fit BIP70 chain name strings
As a side effect, the qt user will see "test" instead of "testnet"
2015-11-04 14:02:10 +01:00
Wladimir J. van der Laan c702521a85
Merge pull request #6864
268b79e [qt] rpcconsole: Scale monospace font to 95% (MarcoFalke)
28313b8 [qt] Use fixed pitch font for the rpc console (MarcoFalke)
2015-11-04 13:06:14 +01:00
Wladimir J. van der Laan 8a95a18562
Merge pull request #6669
6342a48 Init: Use DEFAULT_TRANSACTION_MINFEE in help message (MarcoFalke)
a9c73a1 [wallet] Add comments for doxygen (MarcoFalke)
6b0e622 [wallet] Refactor to use new MIN_CHANGE (MarcoFalke)
2015-11-04 12:30:50 +01:00
Wladimir J. van der Laan aa03fb35c4
Merge pull request #6927
de0499d Fix ZMQ Notification initialization and shutdown (João Barbosa)
2015-11-04 12:10:46 +01:00
Wladimir J. van der Laan aca0c00ae1
Merge pull request #6905
a6efc01 Bugfix: Omit wallet-related options from -help when wallet is disabled (Luke Dashjr)
5f9260f Bugfix: If genproclimit is omitted to RPC setgenerate, don't change it; also show correct default in getmininginfo (Luke Dashjr)
420a82f Bugfix: Describe dblogsize option correctly (it refers to the wallet database, not memory pool) (Luke Dashjr)
caa3d42 Bugfix: RPC: blockchain: Display correct defaults in help for verifychain method (Luke Dashjr)
2015-11-04 11:45:33 +01:00
João Barbosa de0499d3b8 Fix ZMQ Notification initialization and shutdown
Moves the call Initialize() from init.cpp to CreateWithArguments() and handles the
return value. Moves the call Shutdown() from init.cpp to destructor.
Changes Initialize() and Shutdown() to protected members.
2015-11-04 10:36:00 +00:00
Gregory Maxwell d1c3762ae8 Revert "Revert "Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints""
This reverts commit 8537ecdfc4.
2015-11-03 17:14:09 +00:00
Gregory Maxwell e4e5334ef8 Restore MedianTimePast for locktime.
Revert "Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations""
This reverts commit 40cd32e835.

After careful analysis it was determined that the change was, in fact, safe and several people were suffering
momentary confusion about locktime semantics.
2015-11-03 17:12:36 +00:00
MarcoFalke 268b79ef0c [qt] rpcconsole: Scale monospace font to 95% 2015-11-03 12:34:51 +01:00
MarcoFalke 53238ff0b1 Clarify what minrelaytxfee does 2015-11-03 08:53:37 +01:00
MarcoFalke abd8b768ee [qt] Properly display required fee instead of minTxFee 2015-11-03 08:53:37 +01:00
Alex Morcos 14470f9aa6 ModifyNewCoins saves database lookups
When processing a new transaction, in addition to spending the Coins of its txin's it creates a new Coins for its outputs.  The existing ModifyCoins function will first make sure this Coins does not already exist.  It can not exist due to BIP 30, but because of that the lookup can't be cached and always has to go to the database.  Since we are creating the coins to match the new tx anyway, there is no point in checking if they exist first anyway.  However this should not be used for coinbase tx's in order to preserve the historical behavior of overwriting the two existing duplicate tx pairs.
2015-11-02 21:27:15 -05:00
Alex Morcos 33c90cf197 Make skipping BIP30 check chain agnostic 2015-11-02 20:11:55 -05:00
Alex Morcos 06d81ad516 Skip BIP30 check after BIP34 activation 2015-11-02 20:10:24 -05:00
Wladimir J. van der Laan 8fe30fb4d1
Merge pull request #6928
40cd32e Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations" (Gregory Maxwell)
8537ecd Revert "Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints" (Gregory Maxwell)
2015-11-02 04:44:47 +01:00
Wladimir J. van der Laan a6d0d623fc
Merge pull request #6926
7497e80 tests: Initialize networking on windows (Wladimir J. van der Laan)
2015-11-02 04:29:45 +01:00
Pieter Wuille 69d373ff66 Don't wipe the sigcache in TestBlockValidity 2015-11-02 02:01:45 +01:00
Gregory Maxwell 40cd32e835 Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations"
This reverts commit 9d55050773.

As noted by Luke-Jr, under some conditions this will accept transactions which are invalid by the network
 rules.  This happens when the current block time is head of the median time past and a transaction's
 locktime is in the middle.

This could be addressed by changing the rule to MAX(this_block_time, MTP+offset) but this solution and
 the particular offset used deserve some consideration.
2015-11-01 20:05:18 +00:00
Gregory Maxwell 8537ecdfc4 Revert "Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints"
This reverts commit dea8d21fc6.
2015-11-01 20:05:16 +00:00
Wladimir J. van der Laan 02a95be977
qt: translation update prior to opening 0.12 translations
Also update transifex slug for new version.
2015-11-01 16:11:50 +01:00
Wladimir J. van der Laan 7497e805bd tests: Initialize networking on windows 2015-11-01 11:45:06 +01:00
Pieter Wuille 0b9e9dca4e Evict sigcache entries that are seen in a block 2015-10-31 01:15:11 +01:00
Pieter Wuille 830e3f3d02 Make sigcache faster and more efficient 2015-10-31 01:15:11 +01:00
Wladimir J. van der Laan 48b5b84ee5
Merge pull request #6906
30d9662 Reject invalid pubkeys when reading ckey items from the wallet. (Gregory Maxwell)
2015-10-31 00:39:50 +01:00
Wladimir J. van der Laan d482c0a7b2
Merge pull request #6896
e9e6163 Make -checkmempool=1 not fail through int32 overflow (Pieter Wuille)
2015-10-31 00:38:31 +01:00
Jorge Timón 87cbdb8b41 Globals: Explicit Consensus::Params arg for main:
-CheckBlockIndex
-DisconnectTip
-GetTransaction
-InvalidateBlock
-ProcessGetData
-ReadBlockFromDisk
2015-10-30 14:07:30 +01:00
Luke Dashjr a6efc01908 Bugfix: Omit wallet-related options from -help when wallet is disabled 2015-10-30 00:32:08 +01:00
Gregory Maxwell 30d9662bd7 Reject invalid pubkeys when reading ckey items from the wallet.
This makes the behavior more consistent with key objects and will
 reject some corrupted pubkeys (e.g. zero length).
2015-10-29 18:24:49 +00:00
MarcoFalke 28313b83fc [qt] Use fixed pitch font for the rpc console
Also:
* Preserve white space
* Make fixed font as large as default font
2015-10-29 18:01:39 +01:00
MarcoFalke 6342a4889b Init: Use DEFAULT_TRANSACTION_MINFEE in help message 2015-10-29 16:52:40 +01:00
Wladimir J. van der Laan 725539ea03
Merge pull request #6863
0be387a unittest: fix test for null tx input (Daniel Kraft)
2015-10-29 13:40:33 +01:00
Wladimir J. van der Laan b28c229324
Merge pull request #6899
a83f3c2 Add explicit shared_ptr constructor due to C++11 error (Bob McElrath)
2015-10-29 13:39:56 +01:00
Wladimir J. van der Laan b2ce2c1f0f
Merge pull request #6870
040c0ea Init: Cleanup error and warning strings (MarcoFalke)
6782f58 [trivial] Latest config.guess (MarcoFalke)
bf68191 [trivial] rpcnet: fix typo (MarcoFalke)
95f4291 [trivial] Rewrite help text for feature enabled by default (MarcoFalke)
2015-10-29 13:30:42 +01:00
Bob McElrath a83f3c2426 Add explicit shared_ptr constructor due to C++11 error 2015-10-28 22:25:32 -04:00
MarcoFalke 040c0ea093 Init: Cleanup error and warning strings
Also update doc/translation_strings_policy.md
2015-10-28 22:11:43 +01:00
MarcoFalke a9c73a130e [wallet] Add comments for doxygen 2015-10-28 11:15:48 +01:00
MarcoFalke 6b0e622c25 [wallet] Refactor to use new MIN_CHANGE
* Introduce new constant MIN_CHANGE and use it instead of the
hardcoded "CENT"
* Add test case for MIN_CHANGE
* Introduce new constant for -mintxfee default:
  DEFAULT_TRANSACTION_MINFEE = 1000
2015-10-28 10:52:46 +01:00
Alex Morcos 971a4e6b86 Lower default policy limits
Reduce the default limits on maximum number of transactions and the cumulative size of those transactions in both ancestor and descendant packages to 25 txs and 101kb total size.
2015-10-27 23:59:19 -04:00
Pieter Wuille e9e616323b Make -checkmempool=1 not fail through int32 overflow 2015-10-28 03:07:59 +01:00
Pieter Wuille 8daffe227b
Merge pull request #6891
ad5aae1 constify missing catch cases (Philip Kaufmann)
2015-10-28 02:34:09 +01:00
Pieter Wuille 4764f5db9d
Merge pull request #6892
214de7e [Trivial] ensure minimal header conventions (Philip Kaufmann)
2015-10-28 02:30:31 +01:00
Pieter Wuille e06c14fb59
Merge pull request #6776
ab1f560 Support -checkmempool=N, which runs checks on average once every N transactions (Pieter Wuille)
2015-10-28 02:25:06 +01:00
Pieter Wuille 298e040bca Fix chainstate serialized_size computation 2015-10-28 01:05:32 +01:00
Daniel Kraft 0be387a536 unittest: fix test for null tx input
Update the unittest that is meant to catch a transaction that is invalid
because it has a null input.  The old test failed not because of that
but because it was considered a coinbase with too large script.  This is
already checked with a different test, though.

The new test is *not* a coinbase since it has two inputs, but one of
them is null.  This really checks the corresponding code path in
CheckTransaction.
2015-10-27 20:11:56 +01:00
Philip Kaufmann 214de7e54c [Trivial] ensure minimal header conventions
- ensure header namespaces and end comments are correct
- add missing header end comments
- ensure minimal formatting (add newlines etc.)
2015-10-27 17:44:13 +01:00
Philip Kaufmann ad5aae15b4 constify missing catch cases
- ensure all missing catch cases are constant where possible
2015-10-27 17:39:42 +01:00
Wladimir J. van der Laan 8f3b3cdee4
Merge pull request #6464
2d8c49d Clean up tx prioritization when conflict mined (Casey Rodarmor)
2015-10-27 11:58:35 +01:00
Wladimir J. van der Laan 38369dda32
Merge pull request #6889
0d699fc fix locking issue with new mempool limiting (Jonas Schnelli)
2015-10-27 08:48:12 +01:00
Wladimir J. van der Laan 2b625510d3
Merge pull request #6881
7bbc7c3 Add option for microsecond precision in debug.log (Suhas Daftuar)
2015-10-26 21:04:41 +01:00
Suhas Daftuar 7bbc7c314f Add option for microsecond precision in debug.log 2015-10-26 15:05:37 -04:00
Wladimir J. van der Laan 7939164d89
Merge pull request #6622
17a073a Add RPC test for -maxuploadtarget (Suhas Daftuar)
872fee3 Introduce -maxuploadtarget (Jonas Schnelli)
2015-10-26 17:54:00 +01:00
Wladimir J. van der Laan c8322ff7f7
Merge pull request #6888
143d173 Use BOOST_CHECK_MESSAGE() rather than BOOST_CHECK() in alerts_tests.cpp and initialize strMiscWarning before calling PartitionCheck()." (Eric Lombrozo)
2015-10-26 17:25:19 +01:00
Jonas Schnelli 872fee3fcc
Introduce -maxuploadtarget
* -maxuploadtarget can be set in MiB
* if <limit> - ( time-left-in-24h-cycle / 600 * MAX_BLOCK_SIZE ) has reach, stop serve blocks older than one week and filtered blocks
* no action if limit has reached, no guarantee that the target will not be  surpassed
* add outbound limit informations to rpc getnettotals
2015-10-26 15:37:30 +01:00
Jonas Schnelli 0d699fc821
fix locking issue with new mempool limiting
Current master crashes on OSX with an exception: "boost: mutex lock failed in pthread_mutex_lock: Invalid argument"
2015-10-26 14:58:17 +01:00
Wladimir J. van der Laan ff057f41aa
Merge pull request #6566
dea8d21 Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints (Mark Friedenbach)
9d55050 Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations (Mark Friedenbach)
2015-10-26 11:32:46 +01:00
Wladimir J. van der Laan 26f5b34e88
Merge pull request #6877
10e2eae rpc: Add maxmempool and effective min fee to getmempoolinfo (Wladimir J. van der Laan)
2015-10-26 10:07:04 +01:00
Wladimir J. van der Laan 10e2eae35c rpc: Add maxmempool and effective min fee to getmempoolinfo 2015-10-26 09:59:07 +01:00
Eric Lombrozo 143d173969 Use BOOST_CHECK_MESSAGE() rather than BOOST_CHECK() in alerts_tests.cpp and initialize strMiscWarning before calling PartitionCheck()." 2015-10-25 05:47:02 -04:00
dexX7 d425877557
Remove coverage and test related files, when cleaning up
Until now there were quite a few leftovers, and only the coverage
related files in `src/` were cleaned, while the ones in the other dirs
remained. `qa/tmp/` is related to the BitcoinJ tests, and `cache/` is
related to RPC tests.
2015-10-23 22:09:14 +02:00
Mark Friedenbach dea8d21fc6 Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints
Transactions are not allowed in the memory pool or selected for inclusion in a block until their lock times exceed chainActive.Tip()->GetMedianTimePast(). However blocks including transactions which are only mature under the old rules are still accepted; this is *not* the soft-fork required to actually rely on the new constraint in production.
2015-10-23 09:02:24 -07:00
Mark Friedenbach 9d55050773 Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations
The lock-time code currently uses CBlock::nTime as the cutoff point for time based locked transactions. This has the unfortunate outcome of creating a perverse incentive for miners to lie about the time of a block in order to collect more fees by including transactions that by wall clock determination have not yet matured. By using CBlockIndex::GetMedianTimePast from the prior block instead, the self-interested miner no longer gains from generating blocks with fraudulent timestamps. Users can compensate for this change by simply adding an hour (3600 seconds) to their time-based lock times.

If enforced, this would be a soft-fork change. This commit only adds the functionality on an unexecuted code path, without changing the behaviour of Bitcoin Core.
2015-10-23 09:02:24 -07:00
Jeff Garzik 46f74379b8
Merge pull request #6873 2015-10-23 09:01:22 -04:00
Wladimir J. van der Laan c719cefc41
Merge pull request #6856
d3b09f6 Do not allow blockfile pruning during reindex. (Alex Morcos)
2015-10-23 14:41:30 +02:00
Wladimir J. van der Laan 2a1090d4f5
Merge pull request #6351
65ef372 Add BIP65 to getblockchaininfo softforks list (Peter Todd)
cde7ab2 Add RPC tests for the CHECKLOCKTIMEVERIFY (BIP65) soft-fork (Peter Todd)
287f54f Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic (Peter Todd)
2015-10-23 13:33:13 +02:00
Wladimir J. van der Laan bf7c1958d1
Merge pull request #5936
212bcca Add optional locktime to createrawtransaction (Tom Harding)
2015-10-23 12:47:19 +02:00
Wladimir J. van der Laan 923c5e93a9
Merge pull request #6818
b48da5c script:  Remove magic numbers (David Hill)
2015-10-23 11:50:10 +02:00
Wladimir J. van der Laan b2b173acab
Merge pull request #6867
a4e28b3 Set TCP_NODELAY on P2P sockets. (Gregory Maxwell)
2015-10-23 09:29:49 +02:00
MarcoFalke bf681918d7 [trivial] rpcnet: fix typo 2015-10-23 08:35:05 +02:00
Jeff Garzik 3795e8152b leveldbwrapper file rename to dbwrapper.* 2015-10-22 21:33:06 -04:00
Jeff Garzik 8587b23038 leveldbwrapper symbol rename: Remove "Level" from class, etc. names 2015-10-22 21:02:20 -04:00
Jeff Garzik 6ec4b7eb20 leveldbwrapper: Remove unused .Prev(), .SeekToLast() methods
Also, trim trailing whitespace.
2015-10-22 20:49:02 -04:00
Gregory Maxwell a4e28b3d1e Set TCP_NODELAY on P2P sockets.
Nagle appears to be a significant contributor to latency now that the static
 sleeps are gone.  Most of our messages are relatively large compared to
 IP + TCP so I do not expect this to create enormous overhead.

This may also reduce traffic burstyness somewhat.
2015-10-22 17:57:48 +00:00
Wladimir J. van der Laan f2c869aef2
Merge pull request #6848
c6824f8 Add DERSIG transaction test cases (J Ross Nicoll)
2015-10-22 18:02:17 +02:00
Wladimir J. van der Laan 2cd020d054
Merge pull request #6846
3cb56f3 *: alias -h for --help (Daniel Cousens)
2015-10-22 17:53:07 +02:00
Daniel Cousens 3cb56f3778 *: alias -h for --help 2015-10-22 00:07:30 +11:00
Wladimir J. van der Laan 0fbfc5106c
Merge pull request #6859
41db8c4 http: Restrict maximum size of request line + headers (Wladimir J. van der Laan)
2015-10-21 11:19:25 +02:00
Wladimir J. van der Laan 3b20e239c6
Merge pull request #6722
58254aa Fix stale comment in CTxMemPool::TrimToSize. (Matt Corallo)
2bc5018 Fix comment formatting tabs (Matt Corallo)
8abe0f5 Undo GetMinFee-requires-extra-call-to-hit-0 (Matt Corallo)
9e93640 Drop minRelayTxFee to 1000 (Matt Corallo)
074cb15 Add reasonable test case for mempool trimming (Matt Corallo)
d355cf4 Only call TrimToSize once per reorg/blocks disconnect (Matt Corallo)
794a8ce Implement on-the-fly mempool size limitation. (Matt Corallo)
e6c7b36 Print mempool size in KB when adding txn (Matt Corallo)
241d607 Add CFeeRate += operator (Matt Corallo)
e8bcdce Track (and define) ::minRelayTxFee in CTxMemPool (Matt Corallo)
9c9b66f Fix calling mempool directly, instead of pool, in ATMP (Matt Corallo)
49b6fd5 Add Mempool Expire function to remove old transactions (Pieter Wuille)
78b82f4 Reverse the sort on the mempool's feerate index (Suhas Daftuar)
2015-10-21 08:50:16 +02:00
Pieter Wuille ab1f56072a Support -checkmempool=N, which runs checks on average once every N transactions 2015-10-20 18:59:08 +02: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
Wladimir J. van der Laan 41db8c4733 http: Restrict maximum size of request line + headers
Prevent memory exhaustion by sending lots of data.
Also add a test to `httpbasics.py`.

Closes #6425
2015-10-20 14:31:40 +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
Wladimir J. van der Laan c834f56869
Merge pull request #6853
7801f43 Added fPowNoRetargeting field to Consensus::Params that disables nBits recalculation. (Eric Lombrozo)
2015-10-20 12:07:44 +02:00
Wladimir J. van der Laan 488f8517a1
Merge pull request #6829
53b86d0 doc: add comment explaining initial header request (Daniel Kraft)
2015-10-20 12:06:44 +02:00
Alex Morcos d3b09f6bac Do not allow blockfile pruning during reindex.
Also clarify startup message.
2015-10-19 14:43:04 -04:00
Eric Lombrozo 7801f4387d Added fPowNoRetargeting field to Consensus::Params that disables nBits recalculation. 2015-10-19 14:25:21 -04:00
Matt Corallo 58254aa3bc Fix stale comment in CTxMemPool::TrimToSize. 2015-10-19 02:41:52 -07:00
J Ross Nicoll c6824f8a90 Add DERSIG transaction test cases
Add test cases for DERSIG flag enforcement against transactions.
2015-10-18 17:27:41 +01:00
David Hill b48da5c189 script: Remove magic numbers
This adds two new constants, MAX_OPS_PER_SCRIPT and
MAX_PUBKEYS_PER_MULTISIG.
2015-10-15 09:48:15 -04:00
Wladimir J. van der Laan d78a880900
Merge pull request #6820
60af755 build: univalue subdir build fixups (Cory Fields)
2015-10-15 12:55:25 +02:00
Matt Corallo 2bc50187ee Fix comment formatting tabs 2015-10-14 12:46:20 -07:00
Matt Corallo 8abe0f5658 Undo GetMinFee-requires-extra-call-to-hit-0 2015-10-14 12:44:18 -07:00
Daniel Kraft 53b86d0de5 doc: add comment explaining initial header request
Add a comment that explains why the initial "getheader" requests are
made starting from the block preceding the currently best one.

Thanks to sdaftuar for the explanation!
2015-10-14 20:42:49 +02:00
Daniel Kraft f8f2aceadd trivial: use constants for db keys
Replace literal occurances of the key "prefixes" 'c' and 'b' in txdb.cpp
by the respective constants.
2015-10-13 20:25:57 +02:00
Cory Fields 60af755e56 build: univalue subdir build fixups
- Force a rebuild if the headers change
- Only build the lib target
- Clean univalue on 'make clean'
2015-10-13 13:40:49 -04:00
Wladimir J. van der Laan 9caaf6ed22
Merge pull request #6777
dcd8e27 Refer to obfuscate_key via pointer in peripheral CLevelDB classes (James O'Beirne)
1488506 Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator (James O'Beirne)
0fdf8c8 Handle obfuscation in CLevelDBIterator (James O'Beirne)
3499ce1 Encapsulate CLevelDB iterators cleanly (Pieter Wuille)
2015-10-13 12:23:45 +02:00
Wladimir J. van der Laan 01f74999e3
Merge pull request #6798
700f52e Clarification of unit test build instructions. (Eric Lombrozo)
2015-10-13 11:35:24 +02:00
Wladimir J. van der Laan 97bee37d4c
Merge pull request #6788
3b1279f build: match upstream build change (Cory Fields)
313e7f5 Squashed 'src/univalue/' changes from 87d9045..5839ac3 (MarcoFalke)
2015-10-13 10:54:31 +02:00
Matt Corallo 9e93640be6 Drop minRelayTxFee to 1000
There is no exact science to setting this parameter, but 5000
(just over 1 US cent at the time of writing) is higher than the
cost to relay a transaction around the network (the new benchmark
due to mempool limiting).
2015-10-13 01:39:38 -07:00
Matt Corallo 074cb155c2 Add reasonable test case for mempool trimming 2015-10-13 01:39:38 -07:00
Matt Corallo d355cf4420 Only call TrimToSize once per reorg/blocks disconnect 2015-10-13 01:39:38 -07:00
Matt Corallo 794a8cec5d Implement on-the-fly mempool size limitation.
After each transaction which is added to mempool, we first call
Expire() to remove old transactions, then throwing away the
lowest-feerate transactions.

After throwing away transactions by feerate, we set the minimum
relay fee to the maximum fee transaction-and-dependant-set we
removed, plus the default minimum relay fee.

After the next block is received, the minimum relay fee is allowed
to decrease exponentially. Its halflife defaults to 12 hours, but
is decreased to 6 hours if the mempool is smaller than half its
maximum size, and 3 hours if the mempool is smaller than a quarter
its maximum size.

The minimum -maxmempool size is 40*-limitdescendantsize, as it is
easy for an attacker to play games with the cheapest
-limitdescendantsize transactions. -maxmempool defaults to 300MB.

This disables high-priority transaction relay when the min relay
fee adjustment is >0 (ie when the mempool is full). When the relay
fee adjustment drops below the default minimum relay fee / 2 it is
set to 0 (re-enabling priority-based free relay).
2015-10-13 01:39:27 -07:00
Matt Corallo e6c7b362ab Print mempool size in KB when adding txn 2015-10-13 01:05:43 -07:00
Matt Corallo 241d6078ba Add CFeeRate += operator 2015-10-13 01:04:39 -07:00
Matt Corallo e8bcdce8a2 Track (and define) ::minRelayTxFee in CTxMemPool 2015-10-13 01:00:19 -07:00
Matt Corallo 9c9b66f771 Fix calling mempool directly, instead of pool, in ATMP 2015-10-13 00:44:03 -07:00
Pieter Wuille 49b6fd5663 Add Mempool Expire function to remove old transactions
(note the 9x multiplier on (void*)'s for CTxMemPool::DynamicMemoryUsage
 was accidentally introduced in 5add7a7 but should have waited for this
 commit which adds the extra index)
2015-10-13 00:44:03 -07:00
Suhas Daftuar 78b82f4a16 Reverse the sort on the mempool's feerate index 2015-10-13 00:44:03 -07:00
Wladimir J. van der Laan 4e2efb3c5f tests: update transaction_tests for new dust threshold 2015-10-10 14:49:38 +02:00
Eric Lombrozo 700f52e0f6 Clarification of unit test build instructions. 2015-10-10 06:46:35 -04:00
James O'Beirne dcd8e27c65 Refer to obfuscate_key via pointer in peripheral CLevelDB classes
cc @sipa
2015-10-09 10:56:48 -07:00
James O'Beirne 1488506872 Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.
2015-10-09 10:56:39 -07:00
Wladimir J. van der Laan 28e3249e53 Bump minrelaytxfee default
To bridge the time until a dynamic method for determining this fee is
merged.

This is especially aimed at the stable releases (0.10, 0.11) because
full mempool limiting, as will be in 0.12, is too invasive and risky to
backport.
2015-10-09 19:36:32 +02:00
Cory Fields 3b1279fdb2 build: match upstream build change 2015-10-09 11:38:05 +02:00
MarcoFalke 31f4ba97b7 Merge commit '313e7f5c89d6e72e06efe9255089765b4c5815fe' into HEAD 2015-10-09 11:37:00 +02:00
Wladimir J. van der Laan 6cf73b0cd4
Merge pull request #6779
b22692c build: Make use of ZMQ_CFLAGS (Cory Fields)
2015-10-09 10:26:48 +02:00
Wladimir J. van der Laan a99b6cb19e
Merge pull request #6770
b2af29b Ignore bench_bitcoin binary. (Pavel Janík)
2015-10-09 10:15:48 +02:00
James O'Beirne 0fdf8c80ee Handle obfuscation in CLevelDBIterator 2015-10-08 09:32:27 -07:00
Pieter Wuille 3499ce1e1a Encapsulate CLevelDB iterators cleanly
Conflicts:
	src/leveldb.cpp
	src/leveldb.h
	src/txdb.cpp
2015-10-08 09:32:27 -07:00
Peter Todd 65ef372302
Add BIP65 to getblockchaininfo softforks list 2015-10-08 17:37:10 +02:00
Peter Todd 287f54fc90 Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic
Based on the earlier BIP66 soft-fork logic implemented by Pieter
Wuille's 5a47811da5
2015-10-08 17:23:22 +02:00
Cory Fields b22692ce3e build: Make use of ZMQ_CFLAGS 2015-10-08 00:00:55 -04:00
Wladimir J. van der Laan d479311dba
Merge pull request #6720
1534d9a Creates unittests for addrman, makes addrman testable. Adds several unittests for addrman to verify it works as expected. Makes small modifications to addrman to allow deterministic and targeted tests. (EthanHeilman)
2015-10-07 14:59:58 +02:00
Wladimir J. van der Laan 49dd5c629d
Merge pull request #6769
b196b68 Test LowS in standardness, removes nuisance malleability vector. (Gregory Maxwell)
2015-10-07 10:58:37 +02:00
Wladimir J. van der Laan 4fac576c61
Merge pull request #6650
42cb388 Add chainstate obfuscation to avoid spurious antivirus detection (James O'Beirne)
2015-10-06 17:50:46 +02:00
Pavel Janík b2af29b806 Ignore bench_bitcoin binary. 2015-10-06 17:46:12 +02:00
James O'Beirne 42cb388167 Add chainstate obfuscation to avoid spurious antivirus detection
Adds an `obfuscate` parameter to `CLevelDBWrapper` and makes use of it
for all new chainstate stores built via `CCoinsViewDB`. Also adds an
`Xor` method to `CDataStream`.

Thanks to @sipa @laanwj @pstratem @dexX7 @KyrosKrane @gmaxwell.
2015-10-06 07:46:10 -07:00
Wladimir J. van der Laan b7d78fd0bd
Merge pull request #6733
7072c54 Support very-fast-running benchmarks (Gavin Andresen)
535ed92 Simple benchmarking framework (Gavin Andresen)
2015-10-06 16:34:23 +02:00
Wladimir J. van der Laan 3b2d37c619
Merge pull request #6742
58981d4 Changed logging to make -logtimestamps to work also for -printtoconsole (Arne Brutschy)
2015-10-06 09:59:19 +02:00
Gregory Maxwell b196b685c9 Test LowS in standardness, removes nuisance malleability vector.
This adds SCRIPT_VERIFY_LOW_S to STANDARD_SCRIPT_VERIFY_FLAGS which
 will make the node require the canonical 'low-s' encoding for
 ECDSA signatures when relaying or mining.

Consensus behavior is unchanged.

The rational is explained in a81cd96805:
 Absent this kind of test ECDSA is not a strong signature as given
 a valid signature {r, s} both that value and {r, -s mod n} are valid.
 These two encodings have different hashes allowing third parties a
 vector to change users txids.  These attacks are avoided by picking
 a particular form as canonical and rejecting the other form(s); in
 the of the LOW_S rule, the smaller of the two possible S values is
 used.

If widely deployed this change would eliminate the last remaining
 known vector for nuisance malleability on boring SIGHASH_ALL
 p2pkh transactions.  On the down-side it will block most
 transactions made by sufficiently out of date software.

Unlike the other avenues to change txids on boring transactions this
 one was randomly violated by all deployed bitcoin software prior to
 its discovery.  So, while other malleability vectors where made
 non-standard as soon as they were discovered, this one has remained
 permitted.  Even BIP62 did not propose applying this rule to
 old version transactions, but conforming implementations have become
 much more common since BIP62 was initially written.

Bitcoin Core has produced compatible signatures since a28fb70e in
 September 2013, but this didn't make it into a release until 0.9
 in March 2014; Bitcoinj has done so for a similar span of time.
 Bitcoinjs and electrum have been more recently updated.

This does not replace the need for BIP62 or similar, as miners can
 still cooperate to break transactions.  Nor does it replace the
 need for wallet software to handle malleability sanely[1]. This
 only eliminates the cheap and irritating DOS attack.

[1] On the Malleability of Bitcoin Transactions
Marcin Andrychowicz, Stefan Dziembowski, Daniel Malinowski, Łukasz Mazurek
http://fc15.ifca.ai/preproceedings/bitcoin/paper_9.pdf
2015-10-06 03:50:38 +00:00
Luke Dashjr fd55571f06 wallet: Expose GUI labels in RPC 2015-10-02 00:21:38 +00:00
Luke Dashjr 5f9260f458 Bugfix: If genproclimit is omitted to RPC setgenerate, don't change it; also show correct default in getmininginfo 2015-10-01 23:16:42 +00:00
Luke Dashjr 420a82f1ae Bugfix: Describe dblogsize option correctly (it refers to the wallet database, not memory pool) 2015-10-01 23:16:42 +00:00
Luke Dashjr caa3d42f06 Bugfix: RPC: blockchain: Display correct defaults in help for verifychain method 2015-10-01 23:16:42 +00:00
Peter Todd da894ab5da Accept any sequence of PUSHDATAs in OP_RETURN outputs
Previously only one PUSHDATA was allowed, needlessly limiting
applications such as matching OP_RETURN contents with bloom filters that
operate on a per-PUSHDATA level. Now any combination that passes
IsPushOnly() is allowed, so long as the total size of the scriptPubKey
is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings)

Also, this fixes the odd bug where previously the PUSHDATA could be
replaced by any single opcode, even sigops consuming opcodes such as
CHECKMULTISIG. (20 sigops!)
2015-10-01 18:28:13 +02:00
Peter Todd 5d8709c3b7 Add IsPushOnly(const_iterator pc)
Allows IsPushOnly() to be applied to just part of the script for
OP_RETURN outputs.
2015-10-01 18:28:11 +02:00
Peter Todd 6a07eb676a Make TX_SCRIPTHASH clear vSolutionsRet first
Previously unlike other transaction types the TX_SCRIPTHASH would not
clear vSolutionsRet, which means that unlike other transaction types if
it was called twice in a row you would get the result of the previous
invocation as well.
2015-10-01 18:27:22 +02:00
Wladimir J. van der Laan f297042cae
Merge pull request #6637
95acf3c remove $(@F) and subdirs from univalue make (Jonas Schnelli)
9623e93 [Univalue] add univalue over subtree (Jonas Schnelli)
2f9f082 Squashed 'src/univalue/' content from commit 87d9045 (Jonas Schnelli)
0917306 remove univalue, prepare for subtree (Jonas Schnelli)
2015-10-01 16:36:15 +02:00
Jonas Schnelli 95acf3cc6d remove $(@F) and subdirs from univalue make 2015-10-01 14:28:44 +02: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
Jeff Garzik cf9bb11f97
Merge pull request #6588 2015-10-01 05:58:51 -04:00
Wladimir J. van der Laan 12a7712abd
Merge pull request #5924
835c122 Clean up change computation in CreateTransaction. (Daniel Kraft)
2015-10-01 11:20:08 +02:00
Jonas Schnelli 9623e93473 [Univalue] add univalue over subtree
similar to secp256k1 include and compile univalue over a subtree
2015-10-01 10:49:57 +02:00
Jonas Schnelli 6e16a41313 Merge commit '2f9f082b5ef3c495c70598ef23383effef675f9a' as 'src/univalue' 2015-10-01 10:37:19 +02:00
Jonas Schnelli 0917306fdf remove univalue, prepare for subtree 2015-10-01 10:36:50 +02:00
Arne Brutschy 58981d4f7d Changed logging to make -logtimestamps to work also for -printtoconsole 2015-09-30 17:57:28 +02:00
Gavin Andresen 7072c544b5
Support very-fast-running benchmarks
Avoid calling gettimeofday every time through the benchmarking loop, by keeping
track of how long each loop takes and doubling the number of iterations done
between time checks when they take less than 1/16'th of the total elapsed time.
2015-09-30 09:24:42 -04:00
Gavin Andresen 535ed9223d
Simple benchmarking framework
Benchmarking framework, loosely based on google's micro-benchmarking
library (https://github.com/google/benchmark)

Wny not use the Google Benchmark framework? Because adding Even More Dependencies
isn't worth it. If we get a dozen or three benchmarks and need nanosecond-accurate
timings of threaded code then switching to the full-blown Google Benchmark library
should be considered.

The benchmark framework is hard-coded to run each benchmark for one wall-clock second,
and then spits out .csv-format timing information to stdout. It is left as an
exercise for later (or maybe never) to add command-line arguments to specify which
benchmark(s) to run, how long to run them for, how to format results, etc etc etc.
Again, see the Google Benchmark framework for where that might end up.

See src/bench/MilliSleep.cpp for a sanity-test benchmark that just benchmarks
'sleep 100 milliseconds.'

To compile and run benchmarks:
  cd src; make bench

Sample output:

Benchmark,count,min,max,average
Sleep100ms,10,0.101854,0.105059,0.103881
2015-09-30 09:24:42 -04:00
Wladimir J. van der Laan 4f44530bc3
Merge pull request #6680
d76a8ac use CBlockIndex* insted of uint256 for UpdatedBlockTip signal (Jonas Schnelli)
2015-09-30 11:08:30 +02:00
Wladimir J. van der Laan f6ce59cd3c
Merge pull request #6713
43edd51 SanitizeString: Allow hypen char (MarcoFalke)
2015-09-30 00:23:26 +02:00