aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #2033 from sipa/kickconflictsPieter Wuille2012-11-301-1/+2
|\ | | | | Bugfix: remove conflicting transactions from memory pool
| * Bugfix: remove conflicting transactions from memory poolPieter Wuille2012-11-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When a transaction A is in the memory pool, while a transaction B (which shares an input with A) gets accepted into a block, A was kept forever in the memory pool. This commit adds a CTxMemPool::removeConflicts method, which removes transactions that conflict with a given transaction, and all their children. This results in less transactions in the memory pool, and faster construction of new blocks.
* | Merge pull request #2013 from sipa/blockheaderPieter Wuille2012-11-241-30/+47
|\ \ | |/ |/| Split off CBlockHeader from CBlock
| * Split off CBlockHeader from CBlockPieter Wuille2012-11-161-30/+47
| | | | | | | | | | Cleaner and removes the need for the application-specific flags in serialize.h.
* | Merge pull request #1670 from luke-jr/blksubstrJeff Garzik2012-11-151-4/+9
|\ \ | | | | | | Use full block hash as unique identifier in debug.log
| * | Change block references in debug.log to full hash instead of just 0..20Luke Dashjr2012-11-131-1/+1
| | |
| * | Abstract block hash substr extraction (for debug.log) into BlockHashStr inlineLuke Dashjr2012-11-131-4/+9
| |/
* | Merge pull request #2005 from Diapolo/fixes_mainJeff Garzik2012-11-151-4/+2
|\ \ | | | | | | some small fixes for main.cpp/.h
| * | some small fixes for main.cpp/.hPhilip Kaufmann2012-11-111-4/+2
| | | | | | | | | | | | | | | | | | - remove an unwanted ";" at the end of the ~CCoinsView() destructor - in FindBlockPos() and FindUndoPos() only call fclose(), is file is open - fix an error string in the CBlockUndo class
* | | Introduce script verification flagsPieter Wuille2012-11-151-1/+1
| |/ |/| | | | | | | | | | | | | These flags select features to be enabled/disabled during script evaluation/checking, instead of several booleans passed along. Currently these flags are defined: * SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation * SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.
* | o Removed verbose clang warningAlexander Kjeldaas2012-11-111-1/+1
|/
* One-line comments for public main functionsPieter Wuille2012-11-101-0/+28
|
* Add -reindex, to perform in-place reindexing of block chain filesPieter Wuille2012-11-091-4/+6
| | | | | | | Flushes the blktree/ and coins/ databases, and reindexes the block chain files, as if their contents was loaded via -loadblock. Based on earlier work by Jeff Garzik.
* Move ThreadImport to init.cppPieter Wuille2012-11-091-0/+1
|
* Cache size optimizationsPieter Wuille2012-11-041-0/+1
|
* Comments for constantsPieter Wuille2012-11-031-1/+14
|
* Add virtual destructor to CCoinsViewPieter Wuille2012-11-011-0/+3
|
* Merge pull request #1904 from laanwj/2012_10_remove_getorderPieter Wuille2012-10-251-1/+0
|\ | | | | remove "checkorder" P2P command
| * remove "checkorder" and "reply" P2P commandsWladimir J. van der Laan2012-10-031-1/+0
| | | | | | | | | | | | | | These command are a leftover from send-to-IP transactions, which have been removed a long time ago. Also removes CNode::mapRequests and CNode::PushRequests, as these were only used for the mentioned commands.
* | Added some commentsPieter Wuille2012-10-231-1/+16
| | | | | | | | Some clarifications after a code review by Mike Hearn.
* | change blockchain -> block chain (spelling)Philip Kaufmann2012-10-211-2/+2
| | | | | | | | | | - Wiki says "block chain" is correct ;) - remove some unneeded spaces I found in the source, while fixing the spelling
* | Add gettxout and gettxoutsetinfo RPCsPieter Wuille2012-10-201-0/+12
| |
* | LevelDB block and coin databasesPieter Wuille2012-10-201-0/+1
| | | | | | | | | | | | | | | | 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.
* | Use singleton block tree database instancePieter Wuille2012-10-201-1/+5
| |
* | Prepare database format for multi-stage block processingPieter Wuille2012-10-201-16/+97
| | | | | | | | | | This commit adds a status field and a transaction counter to the block indexes.
* | Direct CCoins referencesPieter Wuille2012-10-201-9/+14
| | | | | | | | | | | | | | | | 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-2/+8
| | | | | | | | | | | | 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-20/+10
| | | | | | | | | | | | | | 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-202/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+2
| | | | | | | | | | | | | | | | | | 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-83/+129
| | | | | | | | | | | | | | | | | | | | | | 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/+15
| | | | | | | | | | Create files (one per block) with undo information for the transactions in it.
* | One file per blockPieter Wuille2012-10-201-43/+118
| | | | | | | | | | Refactor of the block storage code, which now stores one file per block. This will allow easier pruning, as blocks can be removed individually.
* | Add CTxUndo: transaction undo informationPieter Wuille2012-10-201-3/+64
| | | | | | | | | | | | | | The CTxUndo class encapsulates data necessary to undo the effects of a transaction on the txout set, namely the previous outputs consumed by it (script + amount), and potentially transaction meta-data when it is spent entirely.
* | Add CCoins: pruned list of transaction outputsPieter Wuille2012-10-201-1/+233
| | | | | | | | | | | | | | | | | | The CCoins class represents a pruned set of transaction outputs from a given transaction. It only retains information about its height in the block chain, whether it was a coinbase transaction, and its unspent outputs (script + amount). It has a custom serializer that has very low redundancy.
* | Compact serialization for amountsPieter Wuille2012-10-201-3/+14
| | | | | | | | | | | | | | 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.
* | Compact serialization for scriptsPieter Wuille2012-10-201-0/+14
| | | | | | | | | | | | | | | | | | | | | | Special serializers for script which detect common cases and encode them much more efficiently. 3 special cases are defined: * Pay to pubkey hash (encoded as 21 bytes) * Pay to script hash (encoded as 21 bytes) * Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes) Other scripts up to 121 bytes require 1 byte + script length. Above that, scripts up to 16505 bytes require 2 bytes + script length.
* | Move external block import to separate threadPieter Wuille2012-10-201-1/+2
|/
* fix -Wformat warnings all over the sourcePhilip Kaufmann2012-10-011-3/+3
|
* Merge pull request #1793 from Diapolo/fix_signed_unsigned_strprintfWladimir J. van der Laan2012-09-211-4/+4
|\ | | | | fix signed/unsigned in strprintf and CNetAddr::GetByte()
| * fix signed/unsigned in strprintf and CNetAddr::GetByte()Philip Kaufmann2012-09-121-4/+4
| | | | | | | | | | | | - I checked every occurance of strprintf() in the code and used %u, where unsigned vars are used - the change to GetByte() was made, as ip is an unsigned char
* | Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik2012-09-181-1/+1
| |
* | Cosmetic: move CTransaction::GetMinFee out of header fileJeff Garzik2012-09-091-47/+1
|/
* Merge branch 'testnet_alert' of git://github.com/gavinandresen/bitcoin-gitGavin Andresen2012-09-051-206/+0
|\
| * Refactor: move alert code from main to alert.cpp/hGavin Andresen2012-08-281-206/+0
| |
* | Changed nprev->pprevxanatos2012-08-281-1/+1
|/ | | It should be pprev, because the next one is pnext, and it's printing the memory address of the CBlockIndex (so pSomething).
* Alert system DoS preventionGavin Andresen2012-08-261-1/+1
| | | | | | | | | | | 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.
* Block height in coinbase as a new block ruleGavin Andresen2012-08-201-1/+7
| | | | | | | | | | | "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-0/+1
|\ | | | | Add 'mempool' P2P command, and extend 'getdata' behavior
| * Add 'mempool' P2P command, and extend 'getdata' behaviorJeff Garzik2012-07-311-0/+1
| | | | | | | | to permit downloading of mempool transactions from the remote peer.