aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix out-of-bounds checkPieter Wuille2013-09-121-1/+2
|
* Longer term workaround for chainstate corruption from negative versions.Gregory Maxwell2013-09-101-1/+6
| | | | | | | | | | | | | | | | | | | | This also makes negative transaction versions non-standard. This avoids an issue triggered in block 256818 where transactions with negative version numbers were incorrectly serialized into the UTXO set. On restart nodes detect the inconsistency and refuse to start so long as a block with these transactions is inside the self-consistency check window, logging "coin database inconsistencies found". The software recommends reindexing, but reindexing does not correct the problem. This should be fixed by changing the chainstate serialization, but working around it seems harmless for now because the version is not used by any network rule currently. A patch free workaround is to start with -checklevel=2 which skips the consistency checks, but the IsStandard change is important for miners in order to protect unpatched nodes.
* Update the bloom state on the real object, not the temporary one.v0.8.4rc2v0.8.4Gregory Maxwell2013-08-211-1/+1
| | | | | This resulted in just passing all transactions to filtered wallets which worked surprisingly well, except where it didn't.
* Fix non-standard disconnected transactions causing mempool orphansPieter Wuille2013-08-211-8/+9
| | | | | Conflicts: src/main.cpp
* Performance optimization for bloom filters.Gregory Maxwell2013-08-211-1/+2
| | | | | | | | This reduces a peer's ability to attack network resources by using a full bloom filter, but without reducing the usability of bloom filters. It sets a default match everything filter for peers and it generalizes a prior optimization to cover more cases.
* Simplify storage of orphan transactionsGavin Andresen2013-08-201-36/+26
| | | | | | | | | Orphan transactions were stored as a CDataStream pointer; this changes the mapOrphanTransactions data structures to store orphans as a CTransaction. This also fixes CVE-2013-4627 by always re-serializing transactions before relaying them.
* Revert "Truncate oversize 'tx' messages before relaying/storing."Gavin Andresen2013-08-201-10/+0
| | | | This reverts commit 7cc960f8f57e7fe90ee7aa0ccd3e3c6c89ec5a25.
* Fix multi-block reorg transaction resurrectionMatt Corallo2013-08-201-3/+3
|
* Truncate oversize 'tx' messages before relaying/storing.Peter Todd2013-06-251-0/+10
| | | | Fixes a memory exhaustion attack on low-memory peers.
* More bestblock records in walletsPieter Wuille2013-05-221-1/+1
| | | | | | | | | | Write bestblock records in wallets: * Every 20160 blocks synced, no matter what (before: none during IBD) * Every 144 blocks after IBD (before: for every block, slow) * When creating a new wallet * At shutdown This should result in far fewer spurious rescans.
* CreateNewBlock performance improvementsPieter Wuille2013-05-211-19/+9
|
* Merge pull request #2577 from gavinandresen/fee_bandaidGavin Andresen2013-05-041-16/+25
|\ | | | | Treat dust outputs as non-standard, un-hardcode TX_FEE constants
| * Un-hardcode TX_FEE constantsGavin Andresen2013-05-031-15/+24
| | | | | | | | | | | | | | Allow setting of MIN_TX_FEE / MIN_RELAY_TX_FEE with -mintxfee / -mintxrelayfee Default values are the same (0.0001 BTC).
| * Define dust transaction outputs, and make them non-standardGavin Andresen2013-05-031-1/+1
| |
* | Allow the default key to be unavailablePieter Wuille2013-04-251-1/+4
|/ | | | This solves the issue where no default key can be added after -salvagewallet.
* Do not invoke DoS for non-canonical sigsPieter Wuille2013-04-181-1/+9
|
* Require strictly-standard encodings in mempoolPieter Wuille2013-04-141-1/+1
|
* Use a uint256 for bnChainWorkPieter Wuille2013-04-121-23/+25
| | | | | | | | | Every block index entry currently requires a separately-allocated CBigNum. By replacing them with uint256, it's just 32 bytes extra in CBlockIndex itself. This should save us a few megabytes in RAM, and less allocation overhead.
* Merge pull request #2478 from sipa/fullhashGavin Andresen2013-04-091-29/+29
|\ | | | | Always print full hashes (tx, block, inv)
| * Always print full hashes (tx, block, inv)Pieter Wuille2013-04-071-29/+29
| |
* | Make sure we always have a node to do IBD fromPieter Wuille2013-04-071-12/+6
|/ | | | | | | | | This introduces the concept of the 'sync node', which is the one we asked for missing blocks. In case the sync node goes away, a new one will be selected. For now, the heuristic is very simple, but it can easily be extended later to add better policies.
* small indentation, space, formatting fixes (no code changes)Philip Kaufmann2013-04-061-6/+6
|
* Merge pull request #2423 from TheBlueMatt/limitedmapalreadyaskedforGavin Andresen2013-04-031-1/+0
|\ | | | | Limited mapAlreadyAskedFor
| * Revert "Actually use mapAlreadyAskedFor."Matt Corallo2013-04-011-1/+0
| | | | | | | | | | | | | | This reverts commit 643160f6e7e5e8ca84bc7d2c1a0f37d9cf43a6e1. Turns out this commit was useless after a more careful reading of CNode::AskFor
* | Merge pull request #2357 from gavinandresen/shutdowncleanupGavin Andresen2013-04-031-97/+48
|\ \ | | | | | | Thread / shutdown cleanup
| * | Clean up shutdown processGavin Andresen2013-04-031-15/+14
| | |
| * | Port Thread* methods to boost::thread_groupGavin Andresen2013-04-031-8/+4
| | |
| * | Rename util.h Sleep --> MilliSleepGavin Andresen2013-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Two reasons for this change: 1. Need to always use boost::thread's sleep, even on Windows, so the sleeps can be interrupted (prior code used Windows' built-in Sleep). 2. I always forgot what units the old Sleep took.
| * | Shutdown cleanup prep-workGavin Andresen2013-04-031-73/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a boost::thread_group object at the qt/bitcoind main-loop level that will hold pointers to all the main-loop threads. This will replace the vnThreadsRunning[] array. For testing, ported the BitcoinMiner threads to use its own boost::thread_group.
* | | Merge pull request #2453 from sipa/txstatsGavin Andresen2013-04-031-2/+3
|\ \ \ | |/ / |/| | Update transaction statistics
| * | Update transaction statisticsPieter Wuille2013-04-041-2/+3
| |/ | | | | | | | | | | | | | | As these were not updated when 'backporting' the 225430 checkpoint into head. Additionally, also report verification progress in debug.log, and tweak the sigcheck-verification-speed-factor a bit.
* | Merge pull request #2420 from sipa/globcleanGavin Andresen2013-04-021-0/+26
|\ \ | |/ |/| Global cleanups
| * Clean up global datastructures at shutdown.Pieter Wuille2013-03-291-0/+26
| | | | | | | | This should make detecting leaks much easier.
* | Process getdata invs separately until send buffer overflowsPieter Wuille2013-03-301-94/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There exists a per-message-processed send buffer overflow protection, where processing is halted when the send buffer is larger than the allowed maximum. This protection does not apply to individual items, however, and getdata has the potential for causing large amounts of data to be sent. In case several hundreds of blocks are requested in one getdata, the send buffer can easily grow 50 megabytes above the send buffer limit. This commit breaks up the processing of getdata requests, remembering them inside a CNode when too many are requested at once.
* | Use per-message send buffer, rather than per connectionPieter Wuille2013-03-291-5/+8
| |
* | Some fixes to CNetMessage processingPieter Wuille2013-03-291-14/+14
| | | | | | | | | | | | * Change CNode::vRecvMsg to be a deque instead of a vector (less copying) * Make sure to acquire cs_vRecvMsg in CNode::CloseSocketDisconnect (as it may be called without that lock).
* | P2P: parse network datastream into header/data components in socket threadJeff Garzik2013-03-291-38/+27
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces CNode::vRecv buffer with a vector of CNetMessage's. This simplifies ProcessMessages() and eliminates several redundant data copies. Overview: * socket thread now parses incoming message datastream into header/data components, as encapsulated by CNetMessage * socket thread adds each CNetMessage to a vector inside CNode * message thread (ProcessMessages) iterates through CNode's CNetMessage vector Message parsing is made more strict: * Socket is disconnected, if message larger than MAX_SIZE or if CMessageHeader deserialization fails (latter is impossible?). Previously, code would simply eat garbage data all day long. * Socket is disconnected, if we fail to find pchMessageStart. We do not search through garbage, to find pchMessageStart. Each message must begin precisely after the last message ends. ProcessMessages() always processes a complete message, and is more efficient: * buffer is always precisely sized, using CDataStream::resize(), rather than progressively sized in 64k chunks. More efficient for large messages like "block". * whole-buffer memory copy eliminated (vRecv -> vMsg) * other buffer-shifting memory copies eliminated (vRecv.insert, vRecv.erase)
* Before 15 May, limit created block size to 500KGavin Andresen2013-03-171-2/+6
|
* CheckBlock rule until 15-May for 10,000 BDB lock compatibilityGavin Andresen2013-03-171-0/+19
|
* Merge pull request #2186 from Diapolo/misc_stuffWladimir J. van der Laan2013-02-231-13/+11
|\ | | | | small changes in init, main, checkpoints.h and bitcoin-qt.pro
| * small changes in init, main, checkpoints.h and bitcoin-qt.proPhilip Kaufmann2013-02-201-13/+11
| | | | | | | | | | | | | | | | | | - remove an unneeded MODAL flag, as MSG_ERROR sets MODAL - re-order an if-clause in main to have bool checks before a function call - fix some log messages that used wrong function names - make a log message use a correct ellipsis - remove some unneded spaces, brackets and line-breaks - fix style for adding files in the Qt project
* | Merge pull request #2221 from sipa/perfoGavin Andresen2013-02-221-18/+19
|\ \ | | | | | | Various performance tweaks to CCoinsView
| * | Various performance tweaks to CCoinsViewPieter Wuille2013-01-261-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | * Pass txid's to CCoinsView functions by reference instead of by value * Add a method to swap CCoins, and use it in some places to avoid a allocating copy + destruct. * Optimize CCoinsViewCache::FetchCoins to do only a single search through the backing map.
* | | Merge pull request #2229 from sipa/preallocGavin Andresen2013-02-221-2/+6
|\ \ \ | |_|/ |/| | Native versions for AllocateFileRange()
| * | Drop padding in blk* when finalizing filePieter Wuille2013-01-301-2/+6
| | |
* | | Improve block database load error reportingPieter Wuille2013-02-171-0/+12
| | |
* | | Merge pull request #2279 from sipa/cvrbip30Gavin Andresen2013-02-061-1/+1
|\ \ \ | | | | | | | | Bugfix CValidationResult for BIP30 + add DoS
| * | | Bugfix CValidationResult for BIP30 + add DoSPieter Wuille2013-02-061-1/+1
| | | |
* | | | Do not call ResendWalletTransactions when reindexing, importing or on IBDRubén Darío Ponticelli2013-02-051-1/+6
|/ / / | | | | | | | | | | | | Calling ResendWalletTransactions when reindexing, importing or on IBD spams other nodes with our old transactions, because they become unconfirmed.
* | | Merge branch 'reindexgen' of git://github.com/sipa/bitcoinGavin Andresen2013-02-051-19/+27
|\ \ \