aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2015-10-11Bump minrelaytxfee defaultWladimir J. van der Laan
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. Github-Pull: #6793 Rebased-From: 28e3249e53b8ef7516636df0f1406466a513095d 4e2efb3c5fde4b1e332cc032e3dc4082ec4e3cac
2015-09-22Merge pull request #6704Wladimir J. van der Laan
5e6d893 travis: for travis generating an extra build (Cory Fields) ceba0f8 PARTIAL: typofixes (found by misspell_fixer) (Veres Lajos) 2ede6b7 add support for miniupnpc api version 14 (Pavel Vasin) 0dfcdd4 rpc-tests: re-enable rpc-tests for Windows (Cory Fields) c9ad65e net: Set SO_REUSEADDR for Windows too (Cory Fields) 0194bdd add unit test for CNetAddr::GetGroup. (Alex Morcos) bdf2542 Fix masking of irrelevant bits in address groups. (Alex Morcos) 65426ac Add missing files to files.md (fanquake) 28d76d2 Handle leveldb::DestroyDB() errors on wipe failure (Adam Weiss) 843469e Use unique name for AlertNotify tempfile (Casey Rodarmor) 4e5ea71 Make sure LogPrint strings are line-terminated (J Ross Nicoll) 3861f0f build: fix libressl detection (Cory Fields) 04507de Avoid leaking file descriptors in RegisterLoad (Casey Rodarmor) 8b59079 Add autogen.sh to source tarball. (randy-waterhouse)
2015-09-21PARTIAL: typofixes (found by misspell_fixer)Veres Lajos
Upstream: 9f68ed6b6d1a9c6436ce37913666165f2b180ee3 (PR #6539)
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. Conflicts: src/init.cpp src/main.cpp Github-Pull: #6274 Rebased-From: 02a6702a82a5b00e0e0351041dd3267308b7f319
2015-04-20Set nSequenceId when a block is fully linkedSuhas Daftuar
Also adds a test to CheckBlockIndex Conflicts: src/main.cpp Rebased-From: c1ecee8f723c2635fbd51100fa09acdb0cbec8a0 Github-Pull: #6010
2015-04-16Fix CheckBlockIndex for reindex.mrbandrews
Some tests in CheckBlockIndex require chainActive.Tip(), but when reindexing, chainActive has not been set on the first call to CheckBlockIndex. reindex.py starts a node, mines 3 blocks, stops, and reindexes with CheckBlockIndex enabled. Rebased-From: 0421c18f3a261f04e83a03f59884e5798af74fd9 Github-Pull: #6012
2015-03-27Add a consistency check for the block chain data structuresPieter Wuille
This adds a -checkblockindex (defaulting to true for regtest), which occasionally does a full consistency check for mapBlockIndex, setBlockIndexCandidates, chainActive, and mapBlocksUnlinked.
2015-03-24Fix InvalidateBlock to add chainActive.Tip to setBlockIndexCandidatesAlex Morcos
Rebased-From: cd3d67cf3b0d573d2c387c2ec35e8b52129863d9 Github-Pull: #5890
2015-03-17Reduce fingerprinting through timestamps in 'addr' messages.Pieter Wuille
Suggested by Jonas Nick. Rebased-From: 9c2737901b5203f267d21d728019d64b46f1d9f3 Github-Pull: #5860
2015-03-12fix InvalidateBlock to repopulate setBlockIndexCandidatesAlex Morcos
Rebased-From: a9af415887f03cb2565895bc55be72748549e527 Github-Pull: #5879
2015-03-11fix possible block db breakage during re-indexCory Fields
When re-indexing, there are a few cases where garbage data may be skipped in the block files. In these cases, the indices are correctly written to the index db, however the pointer to the next position for writing in the current block file is calculated by adding the sizes of the valid blocks found. As a result, when the re-index is finished, the index db is correct for all existing blocks, but the next block will be written to an incorrect offset, likely overwriting existing blocks. Rather than using the sum of all valid blocks to determine the next write position, use the end of the last block written to the file. Don't assume that the current block is the last one in the file, since they may be read out-of-order. Rebased-From: bb6acff07982dda68b5c2ac81c99dbd7255bb9cc Github-Pull: #5864
2015-03-09Ignore getaddr messages on Outbound connections.Ivan Pustogarov
The only time when a client sends a "getaddr" message is when he esatblishes an Outbound connection (see ProcessMessage() in src/main.cpp). Another bitcoin client is expected to receive a "getaddr" message only on Inbound connection. Ignoring "gettaddr" requests on Outbound connections can resolve potential privacy issues (and as was said such request normally do not happen anyway). Rebased-From: dca799e1db6e319fdd47e0bfdb038eab0efabb85 Github-Pull: #5442
2015-02-26Better fingerprinting protection for non-main-chain getdatas.Pieter Wuille
With headers-first we can compare against the best header timestamp, rather than using checkpoints which require code updates to maintain. Rebased-From: 85da07a5a001a563488382435202b74a3e3e964a Github-Pull: #5820
2015-02-24Sanitize command strings before logging them.Gregory Maxwell
Normally bitcoin core does not display any network originated strings without sanitizing or hex encoding. This wasn't done for strcommand in many places. This could be used to play havoc with a terminal displaying the logs, especially with printtoconsole in use. Thanks to Evil-Knievel for reporting this issue. Conflicts: src/main.cpp
2015-02-03Increase block download timeout base from 10 to 20 minutes.Gregory Maxwell
This harmonizes the block fetch timeout with the existing ping timeout and eliminates a guaranteed eventual failure from congestion collapse for a network operating right at its limit. It's unlikely that we wouldn't suffer other failures if we were really anywhere near the network's limit, and a complete avoidance of congestion collapse risk requires (I think) an exponential back-off. So this isn't a major concern, but I think it's also useful for reducing the complexity of understanding out timeouts. Github-Pull: #5647 Rebased-From: 3ff735c99ae75c21397079f49859b81e89a2f5f8
2015-02-03Merge pull request #5714Wladimir J. van der Laan
3916a81 Increase coverage of DERSIG edge cases (Pieter Wuille) 6da2028 Add RPC test for DERSIG BIP switchover logic (Pieter Wuille) 773c30d BIP66 changeover logic (Pieter Wuille) 18695f0 Example unit tests from BIP66 (Pieter Wuille) abfbeaf Change IsDERSignature to BIP66 implementation (Pieter Wuille)
2015-02-03Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille
Rebased-From: 9fddceda44fb5592be179d783f0e5ac616c51c0d Github-Pull: #5719
2015-02-03Use separate SignatureChecker for CMutableTransactionPieter Wuille
Conflicts: src/main.cpp src/script/bitcoinconsensus.cpp Rebased-From: 858809a33e4f690c4ad213f44a6c4465fc2ef025 Github-Pull: #5719
2015-02-01BIP66 changeover logicPieter Wuille
2015-01-12Introduce 10 minute block download timeoutPieter Wuille
This will disconnect peers that do not transfer a block in 10 minutes, plus 5 minutes for every previously queued block with validated headers (accomodating downstream bandwidth down to a few kilobytes per second - below that the node would have trouble staying synchronized anyway). Github-Pull: #5608 Rebased-From: 916130348ca803d762db912307b247f60f9aacd6
2015-01-07Catch LevelDB errors during flushPieter Wuille
Rebased-From: e41345790f1041f5c5e5605d73a0af174769aa55 Github-Pull: #5597
2015-01-07Require sufficent priority for relay of free transactionsPieter Wuille
Rebased-From: 1c52aad540ec1370db60fd68fc3485413e3cb8e1 Github-Pull: #5535
2015-01-03On close of splashscreen interrupt verifyDBThomas Zander
With the splashscreen being able to be closed it is possible to shutdown during the lengthy verifyDB method. (Takes about a minute on my machine). This change allows us to shutdown much sooner. Github-Pull: #5557 Rebased-From: 70477a0bdf6eb6d123ce256f064bbd3bc356c82a
2014-12-23DOS: Respect max per-peer blocks in flight limitAdam Weiss
Don't allow immediate inv driven block downloads if a peer already has MAX_BLOCKS_IN_TRANSIT_PER_PEER active downloads. Prevents bogus inv spam from blowing up block transfer tracking data structures. Rebased-From: c90770430d7c1eb7ece2d4ddb987b0f2210fd86f Github-Pull: #5507
2014-12-23Reject headers that build on an invalid parentPieter Wuille
Rebased-From: 34970223472c9e83689a1c710eebc7c16f152b02 Github-Pull: #5459
2014-12-22Check against MANDATORY flags prior to accepting to mempoolPeter Todd
Previously transactions were only tested again the STANDARD_SCRIPT_VERIFY_FLAGS prior to mempool acceptance, so any bugs in those flags that allowed actually-invalid transactions to pass would result in allowing invalid transactions into the mempool. Fortunately there is a second check in CreateNewBlock() that would prevent those transactions from being mined, resulting in an invalid block, however this could still be exploited as a DoS attack. Rebased-From: 7c041b3b91aa08a8f5863382b865a5174281ad03
2014-12-19add missing CAutoFile::IsNull() check in mainPhilip Kaufmann
Rebased-From: 84857e87e42e412336ea60d0f8544c1679bab827 Github-Pull: #5437
2014-12-08Remove txn which are invalidated by coinbase maturity during reorgMatt Corallo
2014-12-08Remove coinbase-dependant transactions during reorg.Matt Corallo
This still leaves transactions in mempool that are potentially invalid if the maturity period has been reorged out of, but at least they're not missing inputs entirely.
2014-12-05Merge pull request #5181Wladimir J. van der Laan
afd4b94 Move CMerkleBlock and CPartialMerkleTree to their own file (Matt Corallo)
2014-12-05Merge pull request #5308Wladimir J. van der Laan
60d1ecd change nSubsidy's type from int64_t to CAmount (HarryWu)
2014-12-05Move CMerkleBlock and CPartialMerkleTree to their own fileMatt Corallo
2014-12-04Merge pull request #5394Wladimir J. van der Laan
307f7d4 Report script evaluation failures in log and reject messages (Pieter Wuille)
2014-12-02Report script evaluation failures in log and reject messagesPieter Wuille
2014-12-02Make comments in main an init doxygen compatibleMichael Ford
Fix typos where appropriate Update license/copyright
2014-11-28Merge pull request #5316Wladimir J. van der Laan
f86a24b Move `setmocktime` to hidden category (Wladimir J. van der Laan) bd9aebf Introduce a hidden category (Pieter Wuille) 0dd06b2 Delay writing block indexes in invalidate/reconsider (Pieter Wuille) 9b0a8d3 Add 'invalidateblock' and 'reconsiderblock' RPC commands. (Pieter Wuille)
2014-11-27Remove -printblock, -printblocktree, and -printblockindexPieter Wuille
2014-11-26Delay writing block indexes in invalidate/reconsiderPieter Wuille
2014-11-26Add 'invalidateblock' and 'reconsiderblock' RPC commands.Pieter Wuille
These can be used for testing reorganizations or for manual intervention in case of chain forks.
2014-11-26Merge pull request #5158Wladimir J. van der Laan
9ec75c5 Add a locking mechanism to IsInitialBlockDownload to ensure it never goes from false to true. (Ruben Dario Ponticelli) a2d0fc6 Fix IsInitialBlockDownload which was broken by headers first. (Ruben Dario Ponticelli)
2014-11-26Merge pull request #5321Wladimir J. van der Laan
34559c7 Make PruneBlockIndexCandidates safer (Pieter Wuille) cca48f6 Reset setBlockIndexCandidates once block index db loaded (21E14)
2014-11-25Merge pull request #5241Wladimir J. van der Laan
a206950 Introduce separate flushing modes (Pieter Wuille) 51ce901 Improve chainstate/blockindex disk writing policy (Pieter Wuille)
2014-11-24Merge pull request #5154Wladimir J. van der Laan
730b1ed Check pindexBestForkBase for null (21E14)
2014-11-24Introduce separate flushing modesPieter Wuille
2014-11-24Improve chainstate/blockindex disk writing policyPieter Wuille
There are 3 pieces of data that are maintained on disk. The actual block and undo data, the block index (which can refer to positions on disk), and the chainstate (which refers to the best block hash). Earlier, there was no guarantee that blocks were written to disk before block index entries referring to them were written. This commit introduces dirty flags for block index data, and delays writing entries until the actual block data is flushed. With this stricter ordering in writes, it is now safe to not always flush after every block, so there is no need for the IsInitialBlockDownload() check there - instead we just write whenever enough time has passed or the cache size grows too large. Also updating the wallet's best known block is delayed until this is done, otherwise the wallet may end up referring to an unknown block. In addition, only do a write inside the block processing loop if necessary (because of cache size exceeded). Otherwise, move the writing to a point after processing is done, after relaying.
2014-11-24Merge pull request #1816Wladimir J. van der Laan
b867e40 CreateNewBlock: Stick height in coinbase so we pass template sanity check (Luke Dashjr) 60755db submitblock: Check for duplicate submissions explicitly (Luke Dashjr) bc6cb41 QA RPC tests: Add tests block block proposals (Luke Dashjr) 9765a50 Implement BIP 23 Block Proposal (Luke Dashjr) 3dcbb9b Abstract DecodeHexBlk and BIP22ValidationResult functions out of submitblock (Luke Dashjr) 132ea9b miner_tests: Disable checkpoints so they don't fail the subsidy-change test (Luke Dashjr) df08a62 TestBlockValidity function for CBlock proposals (used by CreateNewBlock) (Luke Dashjr) 4ea1be7 CreateNewBlock and miner_tests: Also check generated template is valid by CheckBlockHeader, ContextualCheckBlockHeader, CheckBlock, and ContextualCheckBlock (Luke Dashjr) a48f2d6 Abstract context-dependent block checking from acceptance (Luke Dashjr)
2014-11-23Prioritize and display -testsafemode status in UIdexX7
Like in a real world situation, a safe mode test should also be visible in the UI. A test of safe mode is furthermore mostly relevant for developers, so it should not be overwritten by a warning about a pre-release test build.
2014-11-22Check pindexBestForkBase for null21E14
2014-11-21Merge pull request #5170Wladimir J. van der Laan
092b58d CBlockIndex::GetBlockWork() + GetProofIncrement(nBits) -> GetBlockProof(CBlockIndex) (jtimon) 22c4272 MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h) (jtimon)
2014-11-20Make PruneBlockIndexCandidates saferPieter Wuille