aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
AgeCommit message (Collapse)Author
2015-11-12Merge #6771 from branch 'lowerLimits' of git://github.com/morcos/bitcoinJeff Garzik
2015-11-11Merge pull request #6982Wladimir J. van der Laan
7267843 Globals: Make AcceptBlockHeader static (Fix #6163) (Jorge Timón)
2015-11-11Globals: Make AcceptBlockHeader static (Fix #6163)Jorge Timón
..and at the same time prevent AcceptBlockHeader() from calling global function Params()
2015-11-10Merge pull request #6822Wladimir J. van der Laan
e20d924 [trivial] init: Use defaults MIN_RELAY_TX_FEE & TRANSACTION_MAXFEE (MarcoFalke) 536766c [trivial] New DEFAULT_MIN_RELAY_TX_FEE = 1000 (MarcoFalke) 5f46a7d transaction_tests: Be more strict checking dust (MarcoFalke)
2015-11-10Merge pull request #6163Wladimir J. van der Laan
87cbdb8 Globals: Explicit Consensus::Params arg for main: (Jorge Timón)
2015-11-09[trivial] New DEFAULT_MIN_RELAY_TX_FEE = 1000MarcoFalke
2015-11-05Merge pull request #6934Wladimir J. van der Laan
d1c3762 Revert "Revert "Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints"" (Gregory Maxwell) e4e5334 Restore MedianTimePast for locktime. (Gregory Maxwell)
2015-11-04Merge pull request #6905Wladimir J. van der Laan
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-03Restore MedianTimePast for locktime.Gregory Maxwell
Revert "Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations"" This reverts commit 40cd32e835092c3158175511da5193193ec54939. 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-01Revert "Add rules--presently disabled--for using GetMedianTimePast as ↵Gregory Maxwell
endpoint for lock-time calculations" This reverts commit 9d55050773d57c0e12005e524f2e54d9e622c6e2. 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-10-30Globals: Explicit Consensus::Params arg for main:Jorge Timón
-CheckBlockIndex -DisconnectTip -GetTransaction -InvalidateBlock -ProcessGetData -ReadBlockFromDisk
2015-10-27Lower default policy limitsAlex Morcos
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-23Add rules--presently disabled--for using GetMedianTimePast as endpoint for ↵Mark Friedenbach
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-13Only call TrimToSize once per reorg/blocks disconnectMatt Corallo
2015-10-13Implement on-the-fly mempool size limitation.Matt Corallo
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-13Add Mempool Expire function to remove old transactionsPieter Wuille
(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-01Bugfix: RPC: blockchain: Display correct defaults in help for verifychain methodLuke Dashjr
2015-09-19Track transaction packages in CTxMemPoolEntrySuhas Daftuar
Associate with each CTxMemPoolEntry all the size/fees of descendant mempool transactions. Sort mempool by max(feerate of entry, feerate of descendants). Update statistics on-the-fly as transactions enter or leave the mempool. Also add ancestor and descendant limiting, so that transactions can be rejected if the number or size of unconfirmed ancestors exceeds a target, or if adding a transaction would cause some other mempool entry to have too many (or too large) a set of unconfirmed in- mempool descendants.
2015-08-11Merge pull request #6519Wladimir J. van der Laan
7f1f8f5 Move mempool rejections to new debug category (Wladimir J. van der Laan) 66daed5 Add information to errors in ConnectBlock, CheckBlock (Wladimir J. van der Laan) 6cab808 Remove most logging from transaction validation (Wladimir J. van der Laan) 9003c7c Add function to convert CValidationState to a human-readable message (Wladimir J. van der Laan) dc58258 Introduce REJECT_INTERNAL codes for local AcceptToMempool errors (Wladimir J. van der Laan) fbf44e6 Add debug message to CValidationState for optional extra information (Wladimir J. van der Laan)
2015-08-11Introduce REJECT_INTERNAL codes for local AcceptToMempool errorsWladimir J. van der Laan
Add status codes specific to AcceptToMempool procession of transactions. These can never happen due to block validation, and must never be sent over the P2P network. Add assertions where appropriate.
2015-08-08Add some const declarations where they are appropriate.Daniel Kraft
Declare some arguments of functions as "const" pointers where they are not meant to be modified.
2015-08-05Merge pull request #5913Wladimir J. van der Laan
5922b67 Add assertion and cast before sending reject code (Wladimir J. van der Laan) a651403 Add absurdly high fee message to validation state (for RPC propagation) (Shaul Kfir)
2015-07-23Includes: Cleanup around net main and walletJorge Timón
-Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
2015-07-23TRIVIAL: Missing includesJorge Timón
2015-07-06Merge pull request #6335Wladimir J. van der Laan
9238ecb Policy: MOVEONLY: 3 functions to policy.o: (Luke Dashjr) 627b9de Policy: MOVEONLY: Create policy/policy.h with some constants (Jorge Timón)
2015-07-03Merge pull request #6329Wladimir J. van der Laan
0c37634 acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only (Luke Dashjr)
2015-07-03acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for ↵Luke Dashjr
testnet/regtest only
2015-07-02Merge pull request #6133Wladimir J. van der Laan
e617fe2 Fix various warnings (Luke Dashjr)
2015-06-30Add absurdly high fee message to validation state (for RPC propagation)Shaul Kfir
2015-06-26Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr
- [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp
2015-06-26Policy: MOVEONLY: Create policy/policy.h with some constantsJorge Timón
2015-06-23Fix various warningsLuke Dashjr
Found while building on Debian 7
2015-06-15Merge pull request #6274Wladimir J. van der Laan
02a6702 Add option `-alerts` to opt out of alert system (Wladimir J. van der Laan)
2015-06-15Add option `-alerts` to opt out of alert systemWladimir J. van der Laan
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.
2015-06-12Merge pull request #6256Wladimir J. van der Laan
65b9454 Use best header chain timestamps to detect partitioning (Gavin Andresen)
2015-06-10Merge pull request #6061Wladimir J. van der Laan
eb83719 Consensus: Refactor: Separate Consensus::CheckTxInputs and GetSpendHeight in CheckInputs (Jorge Timón)
2015-06-10Consensus: Refactor: Separate Consensus::CheckTxInputs and GetSpendHeight in ↵Jorge Timón
CheckInputs
2015-06-08Use best header chain timestamps to detect partitioningGavin Andresen
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
2015-06-04use const references where appropriatePhilip Kaufmann
2015-06-02Be stricter in processing unrequested blocksSuhas Daftuar
AcceptBlock will no longer process an unrequested block, unless it has not been previously processed and has more work than chainActive.Tip()
2015-06-01Merge pull request #6183Wladimir J. van der Laan
28bf062 Fix off-by-one error w/ nLockTime in the wallet (Peter Todd)
2015-05-27Chainparams: Explicit CMessageHeader::MessageStartChars to functions in main:Jorge Timón
-UndoWriteToDisk -WriteBlockToDisk
2015-05-27Merge pull request #5669Wladimir J. van der Laan
da29ecb Consensus: MOVEONLY: Move CValidationState from main consensus/validation (jtimon) 27afcd8 Consensus: Refactor: Decouple CValidationState from main::AbortNode() (Cory Fields)
2015-05-27Fix off-by-one error w/ nLockTime in the walletPeter Todd
Previously due to an off-by-one error the wallet ignored nLockTime-by-height transactions that would be valid in the next block even though they are accepted into the mempool. The transactions wouldn't show up until confirmed, nor would they be included in the unconfirmed balance. Similar to the mempool behavior fix in 665bdd3b, the wallet code was calling IsFinalTx() directly without taking into account the fact that doing so tells you if the transaction could have been mined in the *current* block, rather than the next block. To fix this we strip IsFinalTx() of non-consensus-critical functionality, removing the default arguments, and add CheckFinalTx() to check if a transaction will be final in the next block.
2015-05-26Merge pull request #5947Wladimir J. van der Laan
36cba8f Alert if it is very likely we are getting a bad chain (Gavin Andresen)
2015-05-15Chainparams: Refactor: Decouple main::GetBlockValue() from Params() [renamed ↵Jorge Timón
GetBlockSubsidy] Remove redundant getter CChainParams::SubsidyHalvingInterval()
2015-05-15Consensus: MOVEONLY: Move CValidationState from main consensus/validationjtimon
2015-05-15Consensus: Refactor: Decouple CValidationState from main::AbortNode()Cory Fields
2015-05-14Alert if it is very likely we are getting a bad chainGavin Andresen
Create a monitoring task that counts how many blocks have been found in the last four hours. If very few or too many have been found, an alert is triggered. "Very few" and "too many" are set based on a false positive rate of once every fifty years of constant running with constant hashing power, which works out to getting 5 or fewer or 48 or more blocks in four hours (instead of the average of 24). Only one alert per day is triggered, so if you get disconnected from the network (or are being Sybil'ed) -alertnotify will be triggered after 3.5 hours but you won't get another -alertnotify for 24 hours. Tested with a new unit test and by running on the main network with -debug=partitioncheck Run test/test_bitcoin --log_level=message to see the alert messages: WARNING: check your network connection, 3 blocks received in the last 4 hours (24 expected) WARNING: abnormally high number of blocks generated, 60 blocks received in the last 4 hours (24 expected) The -debug=partitioncheck debug.log messages look like: ThreadPartitionCheck : Found 22 blocks in the last 4 hours ThreadPartitionCheck : likelihood: 0.0777702
2015-05-11Write block index more frequently than cache flushesPieter Wuille