aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add NODE_BLOOM service bit and bump protocol versionMatt Corallo2015-09-051-0/+15
| | | | | | | | | | | | | | | | Lets nodes advertise that they offer bloom filter support explicitly. The protocol version bump allows SPV nodes to assume that NODE_BLOOM is set if NODE_NETWORK is set for pre-70011 nodes. Also adds an option to turn bloom filter support off for nodes which advertise a version number >= 70011. Nodes attempting to use bloom filters on such protocol versions are banned, and a later upgade should drop nodes of an older version which attempt to use bloom filters. Much code stolen from Peter Todd. Implements BIP 111
* Record nMinPingUsecTimePatrick Strateman2015-08-221-0/+1
|
* Merge pull request #6539Wladimir J. van der Laan2015-08-191-1/+1
|\ | | | | | | 9f68ed6 typofixes (found by misspell_fixer) (Veres Lajos)
| * typofixes (found by misspell_fixer)Veres Lajos2015-08-101-1/+1
| |
* | Merge pull request #6519Wladimir J. van der Laan2015-08-111-71/+60
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | Move mempool rejections to new debug categoryWladimir J. van der Laan2015-08-111-1/+1
| | | | | | | | | | | | | | | | | | Move mempool rejections to debug category `mempoolrej`, to make it possible to show them without enabling the entire category `mempool` which is high volume.
| * | Add information to errors in ConnectBlock, CheckBlockWladimir J. van der Laan2015-08-111-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Add detailed state information to the errors, as it is no longer being logged downstream. Also add the state information to mempool rejection debug message in ProcessMessages.
| * | Remove most logging from transaction validationWladimir J. van der Laan2015-08-111-59/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary direct logging in CheckTransaction, AcceptToMemoryPool, CheckTxInputs, CScriptCheck::operator() All status information should be returned in the CValidationState. Relevant debug information is also added to the CValidationState using the recently introduced debug message. Do keep the "BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags" error as it is meant to appear as bug in the log.
| * | Add function to convert CValidationState to a human-readable messageWladimir J. van der Laan2015-08-111-0/+8
| | | | | | | | | | | | | | | It is necessary to be able to concisely log a validation state. Convert CValidationState to a human-readable message for logging.
| * | Introduce REJECT_INTERNAL codes for local AcceptToMempool errorsWladimir J. van der Laan2015-08-111-8/+10
| |/ | | | | | | | | | | 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.
* | Add some const declarations where they are appropriate.Daniel Kraft2015-08-081-7/+7
| | | | | | | | | | Declare some arguments of functions as "const" pointers where they are not meant to be modified.
* | Merge pull request #6377Wladimir J. van der Laan2015-08-071-2/+4
|\ \ | |/ |/| | | c433828 Handle no chain tip available in InvalidChainFound() (Ross Nicoll)
| * Handle no chain tip available in InvalidChainFound()Ross Nicoll2015-07-221-2/+4
| | | | | | | | Handle the case where no chain tip is available, in InvalidChainFound(). This fixes a null pointer deference when running unit tests, if the genesis block or block validation code is broken.
* | Merge pull request #5913Wladimir J. van der Laan2015-08-051-4/+6
|\ \ | | | | | | | | | | | | 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)
| * | Add assertion and cast before sending reject codeWladimir J. van der Laan2015-08-051-1/+2
| | | | | | | | | | | | | | | | | | This gets rid of a warning. Add an assertion to make sure that the reject code is in the correct range for the network protocol (if it is outside the range it must be a bug)
| * | Add absurdly high fee message to validation state (for RPC propagation)Shaul Kfir2015-06-301-3/+4
| | |
* | | Merge pull request #6462Wladimir J. van der Laan2015-08-051-1/+1
|\ \ \ | | | | | | | | | | | | | | | | 7b79cbd limit total length of user agent comments (Pavol Rusnak) 557f8ea implement uacomment config parameter which can add comments to user agent as per BIP-0014 (Pavol Rusnak)
| * | | limit total length of user agent commentsPavol Rusnak2015-08-051-1/+1
| | | | | | | | | | | | | | | | Reworked-By: Wladimir J. van der Laan <[email protected]>
* | | | Merge pull request #6498Wladimir J. van der Laan2015-08-031-10/+64
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a8d0407 Move recentRejects initialization to top of InitBlockIndex (Wladimir J. van der Laan) 0847d9c Keep track of recently rejected transactions (Peter Todd) d741371 Only use randomly created nonces in CRollingBloomFilter. (Pieter Wuille) d2d7ee0 Make CRollingBloomFilter set nTweak for you (Peter Todd) a3d65fe Reuse vector hashing code for uint256 (Pieter Wuille) bbe4108 Add uint256 support to CRollingBloomFilter (Peter Todd)
| * | | | Move recentRejects initialization to top of InitBlockIndexWladimir J. van der Laan2015-07-311-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids that premature return in the condition that a new chain is initialized results in NULL pointer errors due to recentReject not being constructed. Also add assertions where it is used.
| * | | | Keep track of recently rejected transactionsPeter Todd2015-07-281-9/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nodes can have divergent policies on which transactions they will accept and relay. This can cause you to repeatedly request and reject the same tx after its inved to you from various peers which have accepted it. Here we add rolling bloom filter to keep track of such rejections, clearing the filter every time the chain tip changes. Credit goes to Alex Morcos, who created the patch that this code is based on. Original code by Peter Todd. Refactored to not construct the filter at startup time by Pieter Wuille.
| * | | | Make CRollingBloomFilter set nTweak for youPeter Todd2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While CBloomFilter is usually used with an explicitly set nTweak, CRollingBloomFilter is only used internally. Requiring every caller to set nTweak is error-prone and redundant; better to have the class handle that for you with a high-quality randomness source. Additionally when clearing the filter it makes sense to change nTweak as well to recover from a bad setting, e.g. due to insufficient randomness at initialization, so the clear() method is replaced by a reset() method that sets a new, random, nTweak value.
* | | | | Make sure LogPrintf strings are line-terminatedWladimir J. van der Laan2015-08-031-1/+1
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | Fix the cases where LogPrint[f] was accidentally called without line terminator, which resulted in concatenated log lines. (see e.g. #6492)
* | | | Merge pull request #6224Wladimir J. van der Laan2015-07-291-3/+14
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 59b49cd Eliminate signed/unsigned comparison warning (Suhas Daftuar) 04b5d23 Replace sleep with syncing using pings (Suhas Daftuar) 6b1066f Ignore whitelisting during IBD for unrequested blocks. (Suhas Daftuar) bfc30b3 Ignore unrequested blocks too far ahead of tip (Suhas Daftuar)
| * | | | Eliminate signed/unsigned comparison warningSuhas Daftuar2015-07-111-1/+1
| | | | |
| * | | | Ignore whitelisting during IBD for unrequested blocks.Suhas Daftuar2015-06-301-2/+6
| | | | |
| * | | | Ignore unrequested blocks too far ahead of tipSuhas Daftuar2015-06-031-1/+8
| | | | |
* | | | | Revert "Cache transaction validation successes"Pieter Wuille2015-07-281-26/+0
| |/ / / |/| | | | | | | | | | | This reverts commit 17b11428c135203342aff38cabc8047e673f38ac.
* | | | Cache transaction validation successesPieter Wuille2015-07-271-0/+26
| | | |
* | | | Merge pull request #5697Wladimir J. van der Laan2015-07-271-0/+8
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | 60c8bac Includes: Cleanup around net main and wallet (Jorge Timón) 9dd793f TRIVIAL: Missing includes (Jorge Timón)
| * | | | Includes: Cleanup around net main and walletJorge Timón2015-07-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
| * | | | TRIVIAL: Missing includesJorge Timón2015-07-231-0/+2
| | |_|/ | |/| |
* | | | Merge pull request #6287Wladimir J. van der Laan2015-07-231-7/+7
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | a794284 locking: add a quick example of GUARDED_BY (Cory Fields) 2b890dd locking: fix a few small issues uncovered by -Wthread-safety (Cory Fields) cd27bba locking: teach Clang's -Wthread-safety to cope with our scoped lock macros (Cory Fields)
| * | | locking: add a quick example of GUARDED_BYCory Fields2015-06-161-7/+7
| | | | | | | | | | | | | | | | | | | | This was chosen not because it's necessarily helpful, but because its locking assumptions were already correct.
* | | | remove unused inv from ConnectTip()Pavel Vasin2015-07-161-2/+1
| | | |
* | | | Merge pull request #6335Wladimir J. van der Laan2015-07-061-138/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | 9238ecb Policy: MOVEONLY: 3 functions to policy.o: (Luke Dashjr) 627b9de Policy: MOVEONLY: Create policy/policy.h with some constants (Jorge Timón)
| * | | | Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr2015-06-261-138/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp
| * | | | Policy: MOVEONLY: Create policy/policy.h with some constantsJorge Timón2015-06-261-0/+2
| | |_|/ | |/| |
* | | | Merge pull request #6329Wladimir J. van der Laan2015-07-031-2/+3
|\ \ \ \ | | | | | | | | | | | | | | | 0c37634 acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only (Luke Dashjr)
| * | | | acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for ↵Luke Dashjr2015-07-031-2/+3
| | | | | | | | | | | | | | | | | | | | testnet/regtest only
* | | | | use CBanEntry as object container for banned nodesJonas Schnelli2015-07-021-1/+1
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | - added a reason enum for a ban - added creation time for a ban Using CBanEntry as container will keep banlist.dat extenable.
* | | | Merge pull request #6299Wladimir J. van der Laan2015-06-261-20/+21
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | 4f40716 test: Move reindex test to standard tests (Wladimir J. van der Laan) 36c97b4 Bugfix: Don't check the genesis block header before accepting it (Jorge Timón)
| * | | | Bugfix: Don't check the genesis block header before accepting itJorge Timón2015-06-211-20/+21
| | |/ / | |/| | | | | | | | | | This fixes an error triggered when running with -reindex after #5975
* | | | Merge pull request #6233Wladimir J. van der Laan2015-06-251-2/+3
|\ \ \ \ | |/ / / |/| | | | | | | 3e91433 Advance pindexLastCommonBlock for blocks in chainActive (Suhas Daftuar)
| * | | Advance pindexLastCommonBlock for blocks in chainActiveSuhas Daftuar2015-06-041-2/+3
| | |/ | |/| | | | | | | | | | | | | 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.
* | | Merge pull request #6274Wladimir J. van der Laan2015-06-151-1/+2
|\ \ \ | | | | | | | | | | | | 02a6702 Add option `-alerts` to opt out of alert system (Wladimir J. van der Laan)
| * | | Add option `-alerts` to opt out of alert systemWladimir J. van der Laan2015-06-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #6256Wladimir J. van der Laan2015-06-121-6/+10
|\ \ \ \ | |/ / / |/| | | | | | | 65b9454 Use best header chain timestamps to detect partitioning (Gavin Andresen)
| * | | Use best header chain timestamps to detect partitioningGavin Andresen2015-06-081-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge pull request #6221Wladimir J. van der Laan2015-06-111-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | c257a8c Prune: Support noncontiguous block files (Adam Weiss)