aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2014-02-17Merge pull request #3666Wladimir J. van der Laan
bbfce8a fix non-standard reason string in main.cpp (Philip Kaufmann)
2014-02-16Merge pull request #3646Wladimir J. van der Laan
5770254 Copyright header updates s/2013/2014 on files whose last git commit was done in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does. (gubatron)
2014-02-14Handle "conflicted" transactions properlyGavin Andresen
Extend CMerkleTx::GetDepthInMainChain with the concept of a "conflicted" transaction-- a transaction generated by the wallet that is not in the main chain or in the mempool, and, therefore, will likely never be confirmed. GetDepthInMainChain() now returns -1 for conflicted transactions (0 for unconfirmed-but-in-the-mempool, and >1 for confirmed). This makes getbalance, getbalance '*', and listunspent all agree when there are mutated transactions in the wallet. Before: listunspent: one 49BTC output getbalance: 96 BTC (change counted twice) getbalance '*': 46 BTC (spends counted twice) After: all agree, 49 BTC available to spend.
2014-02-13fix non-standard reason string in main.cppPhilip Kaufmann
2014-02-11Add HasCanonicalPushes(), and use it in IsStandardTxPieter Wuille
2014-02-09Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron
in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
2014-01-31Limit the number of orphan blocksPieter Wuille
In case the total number of orphan blocks in memory exceeds a limit (currently set to 750), a random orphan block (which is not depended on by another orphan block) is dropped. This means it will need to be downloaded again, but it won't consume memory until then.
2014-01-30Merge pull request #3592Wladimir J. van der Laan
c117d9e Support for error messages and a few more rejection reasons (Luke Dashjr) 14e7ffc Use standard BIP 22 rejection reasons where applicable (Luke Dashjr)
2014-01-29Merge pull request #3370 from sipa/headersfirst3Gavin Andresen
Prepare block connection logic for headers-first
2014-01-29Support for error messages and a few more rejection reasonsLuke Dashjr
2014-01-29Use standard BIP 22 rejection reasons where applicableLuke Dashjr
2014-01-28use english for all reason strings in IsStandardTx()Philip Kaufmann
2014-01-27Prepare block connection logic for headers-first.Pieter Wuille
This changes the block processing logic from "try to atomically switch to a new block" to a continuous "(dis)connect a block, aiming for the assumed best chain". This means the smallest atomic operations on the chainstate become individual block connections or disconnections, instead of entire reorganizations. It may mean that we try to reorganize to one block, fail, and rereorganize again to the old block. This is slower, but doesn't require unbounded RAM. It also means that a ConnectBlock which fails may be no longer called from the ProcessBlock which knows which node sent it. To deal with that, a mapBlockSource is kept, and invalid blocks cause asynchronous "reject" messages and banning (if necessary).
2014-01-27Move only: extract WriteChainState and UpdatedTip from SetBestChain.Pieter Wuille
2014-01-26Fix off-by-one errors in use of IsFinalTx()Peter Todd
Previously CreateNewBlock() didn't take into account the fact that IsFinalTx() without any arguments tests if the transaction is considered final in the *current* block, when both those functions really needed to know if the transaction would be final in the *next* block. Additionally the UI had a similar misunderstanding. Also adds some basic tests to check that CreateNewBlock() is in fact mining nLockTime-using transactions correctly. Thanks to Wladimir J. van der Laan for rebase.
2014-01-23Remove redundant .c_str()sWladimir J. van der Laan
After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
2014-01-23Typesafe strprintf/error/LogPrint functionsWladimir J. van der Laan
Switch to tinyformat-based formatting. Tinyformat is a typesafe drop-in replacement for C99 printf functions: https://github.com/c42f/tinyformat
2014-01-18Merge pull request #3490Wladimir J. van der Laan
7e08e29 better std::exception logging for block/undo files (Philip Kaufmann)
2014-01-11Store orphan blocks in serialized formPieter Wuille
2014-01-06better std::exception logging for block/undo filesPhilip Kaufmann
2014-01-06Merge pull request #3401Wladimir J. van der Laan
012ca1c LoadWallet: acquire cs_wallet mutex before clearing setKeyPool (Wladimir J. van der Laan) 9569168 Document cs_wallet lock and add AssertLockHeld (Wladimir J. van der Laan) 19a5676 Use mutex pointer instead of name for AssertLockHeld (Wladimir J. van der Laan)
2013-12-19Use mutex pointer instead of name for AssertLockHeldWladimir J. van der Laan
This makes it useable for non-global locks such as the wallet and keystore locks.
2013-12-13Move `nTransactionFee` from main.cpp to wallet.cppWladimir J. van der Laan
Transaction fee is only used by the wallet. No need for it to be in main.cpp.
2013-12-08Add main-specific node statePieter Wuille
2013-12-02Sanitize assert usage and refuse to compile with NDEBUG.Gregory Maxwell
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.
2013-12-01Merge pull request #3329 from gavinandresen/syncdebugGavin Andresen
mutex debugging routines: LocksHeld() and AssertLockHeld()
2013-11-30Add verbose boolean to getrawmempoolGavin Andresen
Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
2013-11-30Refactor: move GetValueIn(tx) to tx.GetValueIn()Gavin Andresen
GetValueIn makes more sense as a CTransaction member.
2013-11-30Remove dead transaction replacement codeGavin Andresen
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.
2013-11-29mutex debugging routines: LocksHeld() and AssertLockHeld()Gavin Andresen
2013-11-26Store and use a sanitized subVerMike Hearn
2013-11-26Add some additional logging to give extra network insight.Mike Hearn
2013-11-22cleanup error message consistencyJulian Langschaedel
relicts from the CTransaction refactor.
2013-11-20Merge pull request #3257Wladimir J. van der Laan
379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
2013-11-15core: remove includes in .cpp, if header is already in .hPhilip Kaufmann
- example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
2013-11-14pass nBytes as parameter to GetMinFee(..)Cozz Lovan
2013-11-11misc small changes to polish after include cleanupPhilip Kaufmann
2013-11-10Merge pull request #3199 from sipa/mempoolmoveGavin Andresen
Cleanup refactoring of coins/mempool
2013-11-11New reject p2p messageGavin Andresen
2013-11-10Move CCoins-related logic to coins.{cpp.h}Pieter Wuille
2013-11-10Make CCoinsView use block hashes instead of indicesPieter Wuille
2013-11-10Cleanup code using forward declarations.Brandon Dahler
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.
2013-11-08Merge pull request #3155 from wtogami/split_proto_varWladimir J. van der Laan
Split MIN_PROTO_VERSION into INIT_PROTO_VERSION and MIN_PEER_PROTO_VERSION
2013-11-04No more fHaveGUIWladimir J. van der Laan
No more specific handling of GUI in bitcoin core. Replace the last usage of fHaveGUI with a fForceServer parameter on AppInit2.
2013-11-03process received messages one at a time without sleeping between messagesPatrick Strateman
2013-11-04Refactor: CTxMempool class to its own txmempool.{cpp,h}Gavin Andresen
2013-11-02Merge pull request #3087Pieter Wuille
caca6aa Make some globals in main non-public. (Pieter Wuille) 85eb2ce Do not use the redundant BestInvalidWork record in the block database. (Pieter Wuille)
2013-11-01Merge pull request #3114Pieter Wuille
a616206 Give peer time-adjustment data an own lock (Pieter Wuille)
2013-11-01Make some globals in main non-public.Pieter Wuille
This means they are declared static, and their extern definition in main.h is removed. Also moved CBlockIndexWorkComparator to the .cpp file.
2013-11-01Do not use the redundant BestInvalidWork record in the block database.Pieter Wuille
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