aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Sanitize assert usage and refuse to compile with NDEBUG.Gregory Maxwell2013-12-021-4/+15
| | | | | | | | There were quite a few places where assert() was used with side effects, making operation with NDEBUG non-functional. This commit fixes all the cases I know about, but also adds an #error on NDEBUG because the code is untested without assertions and may still have vulnerabilities if used without assert.
* Merge pull request #3329 from gavinandresen/syncdebugGavin Andresen2013-12-011-0/+2
|\ | | | | mutex debugging routines: LocksHeld() and AssertLockHeld()
| * mutex debugging routines: LocksHeld() and AssertLockHeld()Gavin Andresen2013-11-291-0/+2
| |
* | Add verbose boolean to getrawmempoolGavin Andresen2013-11-301-5/+9
| | | | | | | | | | Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
* | Refactor: move GetValueIn(tx) to tx.GetValueIn()Gavin Andresen2013-11-301-21/+6
| | | | | | | | GetValueIn makes more sense as a CTransaction member.
* | Remove dead transaction replacement codeGavin Andresen2013-11-301-29/+1
|/ | | | | | | This dead code can be resurrected from git history if transaction replacement is ever implemented. Keeping dead code in the source is a bad idea, because it implies it was tested and worked at some point, which is not true.
* Store and use a sanitized subVerMike Hearn2013-11-261-5/+7
|
* Add some additional logging to give extra network insight.Mike Hearn2013-11-261-5/+11
|
* cleanup error message consistencyJulian Langschaedel2013-11-221-3/+3
| | | | relicts from the CTransaction refactor.
* Merge pull request #3257Wladimir J. van der Laan2013-11-201-1/+0
|\ | | | | | | 379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
| * core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-1/+0
| | | | | | | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* | pass nBytes as parameter to GetMinFee(..)Cozz Lovan2013-11-141-3/+2
|/
* misc small changes to polish after include cleanupPhilip Kaufmann2013-11-111-9/+9
|
* Merge pull request #3199 from sipa/mempoolmoveGavin Andresen2013-11-101-176/+19
|\ | | | | Cleanup refactoring of coins/mempool
| * Move CCoins-related logic to coins.{cpp.h}Pieter Wuille2013-11-101-166/+4
| |
| * Make CCoinsView use block hashes instead of indicesPieter Wuille2013-11-101-26/+31
| |
* | New reject p2p messageGavin Andresen2013-11-111-46/+123
|/
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-76/+76
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Merge pull request #3155 from wtogami/split_proto_varWladimir J. van der Laan2013-11-081-3/+2
|\ | | | | Split MIN_PROTO_VERSION into INIT_PROTO_VERSION and MIN_PEER_PROTO_VERSION
| * Split MIN_PROTO_VERSION into INIT_PROTO_VERSION and MIN_PEER_PROTO_VERSIONWarren Togami2013-10-251-3/+2
| | | | | | | | | | INIT_PROTO_VERSION is the initial version, after a succesful version/verack it is increased to a negotiated version. MIN_PEER_PROTO_VERSION could be a different value to disconnect from peers older than a specified version.
* | No more fHaveGUIWladimir J. van der Laan2013-11-041-1/+0
| | | | | | | | | | | | No more specific handling of GUI in bitcoin core. Replace the last usage of fHaveGUI with a fForceServer parameter on AppInit2.
* | process received messages one at a time without sleeping between messagesPatrick Strateman2013-11-031-1/+9
| |
* | Refactor: CTxMempool class to its own txmempool.{cpp,h}Gavin Andresen2013-11-041-191/+67
| |
* | Merge pull request #3087Pieter Wuille2013-11-021-19/+32
|\ \ | | | | | | | | | | | | caca6aa Make some globals in main non-public. (Pieter Wuille) 85eb2ce Do not use the redundant BestInvalidWork record in the block database. (Pieter Wuille)
| * | Make some globals in main non-public.Pieter Wuille2013-11-011-6/+21
| | | | | | | | | | | | | | | | | | This means they are declared static, and their extern definition in main.h is removed. Also moved CBlockIndexWorkComparator to the .cpp file.
| * | Do not use the redundant BestInvalidWork record in the block database.Pieter Wuille2013-11-011-14/+12
| | | | | | | | | | | | | | | | | | As block index entries have a flag for marking invalid blocks, the 'best invalid work' information can be derived from there. In addition, remove the global from main.h
* | | Merge pull request #3114Pieter Wuille2013-11-011-2/+3
|\ \ \ | |/ / |/| | | | | a616206 Give peer time-adjustment data an own lock (Pieter Wuille)
| * | Give peer time-adjustment data an own lockPieter Wuille2013-10-261-2/+3
| |/ | | | | | | | | Instead of relying on cs_main (defined in a different module) to prevent concurrent access to it.
* | re-work -debug switch handlingPhilip Kaufmann2013-10-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | - re-work -debug help message text - make -debug log every debugging information again (even all categories) - remove unneeded fDebug checks in front of LogPrint()/qDebug(), as that check is done in LogPrintf() when category is != NULL (true for all LogPrint() calls - remove fDebug ONLY in code which is NOT performance-critical - harmonize addrman category name - deprecate -debugnet usage, should be used via -debug=net and remove the corresponding global
* | Merge pull request #3115 from sipa/walletmainGavin Andresen2013-10-291-119/+46
|\ \ | | | | | | Interaction cleanups between main and wallet
| * | Break dependency of init on wallet.Pieter Wuille2013-10-261-21/+0
| | | | | | | | | | | | | | | | | | This required some code movement (what was CWalletTx::AcceptToMemoryPool doing in main?), and adding a few explicit includes that used to be implicit through init.h.
| * | Use boost signals for callbacks from main to walletPieter Wuille2013-10-261-69/+46
| | |
| * | Remove broken PrintWallet functionalityPieter Wuille2013-10-261-10/+0
| | |
| * | Do not treat fFromMe transaction differently when broadcastingPieter Wuille2013-10-261-19/+0
| |/
* | Generalize the remove-outputs check for fully-prunable transactions.Pieter Wuille2013-10-281-6/+6
| | | | | | | | | | | | | | | | | | Instead of explicitly testing for the presence of any output, and dealing with this case specially, just interpret it as an empty CCoins. The case previously caught using the HaveCoins check, is now handled by the generic outs != outsBlock test.
* | Fix comparison tool by asking for blocks more aggressivelyMatt Corallo2013-10-271-2/+2
| |
* | Send multiple inv messages if mempool.size > MAX_INV_SZGavin Andresen2013-10-261-2/+4
|/ | | | | | Changes the response to the 'mempool' command so that if the memory pool has more than MAX_INV_SZ transactions (50,000) it will respond with multiple 'inv' messages.
* Merge pull request #2738 from jgarzik/op_returnGavin Andresen2013-10-211-2/+13
|\ | | | | Relay OP_RETURN data TxOut as standard transaction type.
| * Relay OP_RETURN data TxOut as standard transaction typeJeff Garzik2013-10-021-2/+13
| |
* | Merge pull request #2840 from sipa/nosendlockGavin Andresen2013-10-201-21/+36
|\ \ | | | | | | Allow SendMessages to run partially without cs_main
| * | Push down cs_main locking in ProcessMessagePieter Wuille2013-10-151-5/+18
| | |
| * | Allow SendMessages to run partially without cs_mainPieter Wuille2013-10-151-16/+18
| | | | | | | | | | | | | | | | | | SendMessages() tries to acquire a cs_main lock now, but this isn't nessecary for much of its functionality. Move those parts out of the locked section, so they can always be performed, and we hold cs_main for a shorter time.
* | | Merge pull request #3119Pieter Wuille2013-10-201-1/+1
|\ \ \ | | | | | | | | | | | | db0e8cc Bump Year Number to 2013 (super3)
| * | | Bump Year Number to 2013super32013-10-201-1/+1
| | | |
* | | | Merge pull request #2884 from gavinandresen/canonicalsizes2Gavin Andresen2013-10-191-1/+0
|\ \ \ \ | | | | | | | | | | Reject non-canonically-encoded CompactSize
| * | | | Reject non-canonically-encoded sizesGavin Andresen2013-08-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The length of vectors, maps, sets, etc are serialized using Write/ReadCompactSize -- which, unfortunately, do not use a unique encoding. So deserializing and then re-serializing a transaction (for example) can give you different bits than you started with. That doesn't cause any problems that we are aware of, but it is exactly the type of subtle mismatch that can lead to exploits. With this pull, reading a non-canonical CompactSize throws an exception, which means nodes will ignore 'tx' or 'block' or other messages that are not properly encoded. Please check my logic... but this change is safe with respect to causing a network split. Old clients that receive non-canonically-encoded transactions or blocks deserialize them into CTransaction/CBlock structures in memory, and then re-serialize them before relaying them to peers. And please check my logic with respect to causing a blockchain split: there are no CompactSize fields in the block header, so the block hash is always canonical. The merkle root in the block header is computed on a vector<CTransaction>, so any non-canonical encoding of the transactions in 'tx' or 'block' messages is erased as they are read into memory by old clients, and does not affect the block hash. And, as noted above, old clients re-serialize (with canonical encoding) 'tx' and 'block' messages before relaying to peers.
* | | | | Merge pull request #3008 from gavinandresen/CENTruleGavin Andresen2013-10-191-6/+9
|\ \ \ \ \ | | | | | | | | | | | | Two small free transaction policy changes
| * | | | | Lower maximum size for free transaction creationGavin Andresen2013-10-041-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the maximum size of a free transaction that will be created from 10,000 bytes to 1,000 bytes. The idea behind this change is to make the free transaction area available to a greater number of people; with the default 27K-per-block, just three very-large very-high-priority transactions could fill the space.
| * | | | | Remove CENT-output free transaction rule when relayingGavin Andresen2013-10-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the (relay/mempool) rule that all outputs of free transactions must be greater than 0.01 XBT. Dust spam is now taken care of by making dusty outputs non-standard.
* | | | | | Merge pull request #3083 from sipa/chainlocatorGavin Andresen2013-10-151-85/+38
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | CBlockLocator improvements & move to core