aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Bugfix: add missing fee checkPieter Wuille2012-10-231-0/+3
| |
* | Bugfix: off-by-one error in coinbase maturity checkPieter Wuille2012-10-231-3/+5
| |
* | change blockchain -> block chain (spelling)Philip Kaufmann2012-10-211-5/+5
| | | | | | | | | | - Wiki says "block chain" is correct ;) - remove some unneeded spaces I found in the source, while fixing the spelling
* | remove init messages from ThreadImport()Philip Kaufmann2012-10-211-3/+0
| | | | | | | | | | | | - remove uiInterface.InitMessage() calls from ThreadImport(), as Qt doesn't like them getting called out of it's main thread and because the thread will continue to run after the GUI was loaded
* | Add gettxout and gettxoutsetinfo RPCsPieter Wuille2012-10-201-0/+2
| |
* | LevelDB block and coin databasesPieter Wuille2012-10-201-0/+112
| | | | | | | | | | | | | | | | Split off CBlockTreeDB and CCoinsViewDB into txdb-*.{cpp,h} files, implemented by either LevelDB or BDB. Based on code from earlier commits by Mike Hearn in his leveldb branch.
* | Flush and sync block dataPieter Wuille2012-10-201-8/+21
| |
* | Use singleton block tree database instancePieter Wuille2012-10-201-37/+24
| |
* | Prepare database format for multi-stage block processingPieter Wuille2012-10-201-25/+89
| | | | | | | | | | This commit adds a status field and a transaction counter to the block indexes.
* | Direct CCoins referencesPieter Wuille2012-10-201-49/+53
| | | | | | | | | | | | | | | | To prevent excessive copying of CCoins in and out of the CCoinsView implementations, introduce a GetCoins() function in CCoinsViewCache with returns a direct reference. The block validation and connection logic is updated to require caching CCoinsViews, and exploits the GetCoins() function heavily.
* | Transaction hash cachingPieter Wuille2012-10-201-20/+20
| | | | | | | | | | | | Use CBlock's vMerkleTree to cache transaction hashes, and pass them along as argument in more function calls. During initial block download, this results in every transaction's hash to be only computed once.
* | Batch block connection during IBDPieter Wuille2012-10-201-87/+59
| | | | | | | | | | | | | | During the initial block download (or -loadblock), delay connection of new blocks a bit, and perform them in a single action. This reduces the load on the database engine, as subsequent blocks often update an earlier block's transaction already.
* | UltraprunePieter Wuille2012-10-201-560/+531
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches bitcoin's transaction/block verification logic to use a "coin database", which contains all unredeemed transaction output scripts, amounts and heights. The name ultraprune comes from the fact that instead of a full transaction index, we only (need to) keep an index with unspent outputs. For now, the blocks themselves are kept as usual, although they are only necessary for serving, rescanning and reorganizing. The basic datastructures are CCoins (representing the coins of a single transaction), and CCoinsView (representing a state of the coins database). There are several implementations for CCoinsView. A dummy, one backed by the coins database (coins.dat), one backed by the memory pool, and one that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock, DisconnectBlock, ... now operate on a generic CCoinsView. The block switching logic now builds a single cached CCoinsView with changes to be committed to the database before any changes are made. This means no uncommitted changes are ever read from the database, and should ease the transition to another database layer which does not support transactions (but does support atomic writes), like LevelDB. For the getrawtransaction() RPC call, access to a txid-to-disk index would be preferable. As this index is not necessary or even useful for any other part of the implementation, it is not provided. Instead, getrawtransaction() uses the coin database to find the block height, and then scans that block to find the requested transaction. This is slow, but should suffice for debug purposes.
* | Pre-allocate block and undo files in chunksPieter Wuille2012-10-201-9/+32
| | | | | | | | | | | | | | | | | | Introduce a AllocateFileRange() function in util, which wipes or at least allocates a given range of a file. It can be overriden by more efficient OS-dependent versions if necessary. Block and undo files are now allocated in chunks of 16 and 1 MiB, respectively.
* | Multiple blocks per filePieter Wuille2012-10-201-18/+108
| | | | | | | | | | | | | | | | | | | | | | Change the block storage layer again, this time with multiple files per block, but tracked by txindex.dat database entries. The file format is exactly the same as the earlier blk00001.dat, but with smaller files (128 MiB for now). The database entries track how many bytes each block file already uses, how many blocks are in it, which range of heights is present and which range of dates.
* | Preliminary undo file creationPieter Wuille2012-10-201-0/+17
| | | | | | | | | | Create files (one per block) with undo information for the transactions in it.
* | One file per blockPieter Wuille2012-10-201-69/+34
| | | | | | | | | | Refactor of the block storage code, which now stores one file per block. This will allow easier pruning, as blocks can be removed individually.
* | Compact serialization for amountsPieter Wuille2012-10-201-0/+54
| | | | | | | | | | | | | | Special serializer/deserializer for amount values. It is optimized for values which have few non-zero digits in decimal representation. Most amounts currently in the txout set take only 1 or 2 bytes to represent.
* | Merge pull request #1880 from sipa/threadimportJeff Garzik2012-10-201-5/+55
|\ \ | | | | | | Move external block import to separate thread
| * | Move external block import to separate threadPieter Wuille2012-10-201-5/+55
| | |
* | | Merge pull request #1742 from sipa/canonicalJeff Garzik2012-10-201-4/+4
|\ \ \ | |/ / |/| | Check for canonical public keys and signatures
| * | Check for canonical public keys and signaturesPieter Wuille2012-09-211-4/+4
| | | | | | | | | | | | Only enabled inside tests for now.
* | | Merge pull request #1834 from jgarzik/kickblocksJeff Garzik2012-10-081-0/+1
|\ \ \ | | | | | | | | P2P: Do not request blocks from peers with fewer blocks than us
| * | | P2P: Do not request blocks from peers with fewer blocks than usJeff Garzik2012-09-241-0/+1
| |/ / | | | | | | | | | | | | If the remote node has a shorter chain, do not waste our special getblocks request on them.
* | | Revert "Send 'mempool' P2P command at the start of each P2P session"Jeff Garzik2012-10-081-14/+0
| | | | | | | | | | | | | | | | | | Fat-fingered on github, and merged this too early. This reverts commit 22f9b069035c9ba0416a62714db167eea5ba762f.
* | | Merge pull request #1833 from jgarzik/mempool-queryJeff Garzik2012-10-081-0/+14
|\ \ \ | |_|/ |/| | Send 'mempool' P2P command at the start of each P2P session
| * | Send 'mempool' P2P command at the start of each P2P sessionJeff Garzik2012-09-241-0/+14
| |/ | | | | | | to query remote node mempool contents.
* / fix -Wformat warnings all over the sourcePhilip Kaufmann2012-10-011-17/+17
|/
* When rejected TX relay due to lack of fees, log full txidJeff Garzik2012-09-181-1/+1
|
* Merge pull request #1812 from jgarzik/misc-07Jeff Garzik2012-09-181-2/+54
|\ | | | | Two minor generic cleanups done during OP_DROP hacking
| * Improve debug logging, for mempool TXs that do not include sufficient feesJeff Garzik2012-09-091-2/+5
| |
| * Cosmetic: move CTransaction::GetMinFee out of header fileJeff Garzik2012-09-091-0/+49
| |
* | Apply BIP30 checks to all blocks except the two historic violations.Gregory Maxwell2012-09-091-3/+6
|/ | | | | | | | | Matt pointed out some time ago that there existed a minor DOS attack where a node in its initial block download could be wedged by an overwrite attack in a fork created between checkpoints before a time where BIP30 was enforced. Now that the BIP30 timestamp is irreversibly past the check can be more aggressive and apply to all blocks except the two historic violations.
* Merge branch 'testnet_alert' of git://github.com/gavinandresen/bitcoin-gitGavin Andresen2012-09-051-87/+3
|\
| * Refactor: move alert code from main to alert.cpp/hGavin Andresen2012-08-281-87/+3
| |
* | fix signed/unsigned usage in BlockFilePath()Philip Kaufmann2012-09-051-1/+1
| |
* | Add block file naming helper, BlockFilePath()Jeff Garzik2012-09-041-1/+7
| |
* | Merge pull request #1779 from xanatos/patch-15Jeff Garzik2012-09-041-1/+0
|\ \ | | | | | | Useless vector declaration
| * | Useless vector declarationxanatos2012-09-031-1/+0
| |/ | | | | The vector isn't referenced in the small code block it's declared. I don't see any "useful" side effect in its declaration.
* / Rename CreateThread to NewThreadWladimir J. van der Laan2012-08-291-2/+2
|/ | | | Prevent clash with win32 API symbol
* Special-case the last alert for alert-key-compromised caseGavin Andresen2012-08-271-0/+22
| | | | | | | | | | Hard-code a special nId=max int alert, to be broadcast if the alert key is ever compromised. It applies to all versions, never expires, cancels all previous alerts, and has a fixed message: URGENT: Alert key compromised, upgrade required Variations are not allowed (ignored), so an attacker with the private key cannot broadcast empty-message nId=max alerts.
* Alert system DoS preventionGavin Andresen2012-08-261-6/+19
| | | | | | | | | | | This fixes two alert system vulnerabilities found by Sergio Lerner; you could send peers unlimited numbers of invalid alert message to try to either fill up their debug.log with messages and/or keep their CPU busy checking signatures. Fixed by disconnecting/banning peers if they send 10 or more bad (invalid/expired/cancelled) alerts.
* Make 0-value outputs non-standardPieter Wuille2012-08-241-1/+4
|
* Avoid leaving return types or function attributes on their own lines.Gregory Maxwell2012-08-241-2/+1
|
* Do not accept orphan blocks in -loadblock modePieter Wuille2012-08-211-6/+9
|
* Reject block.nVersion<=1 blocks if network has upgraded to version=2Gavin Andresen2012-08-201-1/+10
| | | | | | | | | | | If 950 of the last 1,000 blocks are nVersion=2, reject nVersion=1 (or zero, but no bitcoin release has created block.nVersion=0) blocks -- 75 of last 100 on testnet3. This rule is being put in place now so that we don't have to go through another "express support" process to get what we really want, which is for every single new block to include the block height in the coinbase.
* Block height in coinbase as a new block ruleGavin Andresen2012-08-201-1/+27
| | | | | | | | | | | "Version 2" blocks are blocks that have nVersion=2 and have the block height as the first item in their coinbase. Block-height-in-the-coinbase is strictly enforced when version=2 blocks are a supermajority in the block chain (750 of the last 1,000 blocks on main net, 51 of 100 for testnet). This does not affect old clients/miners at all, which will continue producing nVersion=1 blocks, and which will continue to be valid.
* Merge pull request #1641 from jgarzik/mempoolJeff Garzik2012-08-201-3/+32
|\ | | | | Add 'mempool' P2P command, and extend 'getdata' behavior
| * Add 'mempool' P2P command, and extend 'getdata' behaviorJeff Garzik2012-07-311-3/+32
| | | | | | | | to permit downloading of mempool transactions from the remote peer.
* | Merge pull request #1678 from Diapolo/LoadExternalBlockFile_add_timerJeff Garzik2012-08-171-1/+3
|\ \ | | | | | | log how long LoadExternalBlockFile() takes in ms (Benchmark)