aboutsummaryrefslogtreecommitdiff
path: root/src/txdb.cpp
AgeCommit message (Collapse)Author
2017-08-14scripted-diff: stop using the gArgs wrappersMarko Bencun
They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
2017-08-07Skip remainder of init if upgrade is cancelledMatt Corallo
2017-07-27Force on-the-fly compaction during pertxout upgradePieter Wuille
2017-07-07Avoid dereference-of-casted-pointerPieter Wuille
2017-06-29Report [CANCELLED] instead of [DONE] when shut down during txdb upgradeJonas Schnelli
2017-06-29Report txdb upgrade not more often then every 10%Jonas Schnelli
2017-06-29Show txdb upgrade progress in debug logJonas Schnelli
2017-06-29Allow to cancel the txdb upgrade via splashscreen callbackJonas Schnelli
2017-06-29Allow to shut down during txdb upgradeJonas Schnelli
2017-06-26[qa] Test non-atomic chainstate writesSuhas Daftuar
Adds new functional test, dbcrash.py, which uses -dbcrashratio to exercise the logic for recovering from a crash during chainstate flush. dbcrash.py is added to the extended tests, as it may take ~10 minutes to run Use _Exit() instead of exit() for crash simulation This eliminates stderr output such as: terminate called without an active exception or Assertion failed: (!pthread_mutex_destroy(&m)), function ~recursive_mutex, file /usr/local/include/boost/thread/pthread/recursive_mutex.hpp, line 104. Eliminating the stderr output on crash simulation allows testing with test_runner.py, which reports a test as failed if stderr is produced.
2017-06-26Dont create pcoinsTip until after ReplayBlocks.Matt Corallo
This requires that we not access pcoinsTip in InitBlockIndex's FlushStateToDisk (so we just skip it until later in AppInitMain) and the LoadChainTip in LoadBlockIndex (which there is already one later in AppinitMain, after ReplayBlocks, so skipping it there is fine). Includes some simplifications by Suhas Daftuar and Pieter Wuille.
2017-06-26Random db flush crash simulatorPieter Wuille
2017-06-26Non-atomic flushing using the blockchain as replay journalPieter Wuille
2017-06-25Merge #9176: Globals: Pass Consensus::Params through ↵Wladimir J. van der Laan
CBlockTreeDB::LoadBlockIndexGuts() b324b28 Globals: Pass Consensus::Params through CBlockTreeDB::LoadBlockIndexGuts() (Jorge Timón) Tree-SHA512: 9ef561a026960dc69df52603f4d60246c913bdd127465e8238f0954c6bbbc6b8b3b039bab70df38be1cbf5d06788fb631a2236b49c0167633d54366103c7c055
2017-06-01scripted-diff: various renames for per-utxo consistencyPieter Wuille
Thanks to John Newberry for pointing these out. -BEGIN VERIFY SCRIPT- sed -i 's/\<GetCoins\>/GetCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<HaveCoins\>/HaveCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<HaveCoinsInCache\>/HaveCoinInCache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<IsPruned\>/IsSpent/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<FetchCoins\>/FetchCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<CoinsEntry\>/CoinEntry/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<vHashTxnToUncache\>/coins_to_uncache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<vHashTxToUncache\>/coins_to_uncache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<fHadTxInCache\>/had_coin_in_cache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<coinbaseids\>/coinbase_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<disconnectedids\>/disconnected_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<duplicateids\>/duplicate_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<oldcoins\>/old_coin/g' src/test/coins_tests.cpp sed -i 's/\<origcoins\>/orig_coin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h -END VERIFY SCRIPT-
2017-06-01Rename CCoinsCacheEntry::coins to coinPieter Wuille
2017-06-01[MOVEONLY] Move old CCoins class to txdb.cppPieter Wuille
It's only used for upgrading from the old database anymore.
2017-06-01Upgrade from per-tx database to per-txoutPieter Wuille
2017-06-01Switch CCoinsView and chainstate db from per-txid to per-txoutPieter Wuille
This patch makes several related changes: * Changes the CCoinsView virtual methods (GetCoins, HaveCoins, ...) to be COutPoint/Coin-based rather than txid/CCoins-based. * Changes the chainstate db to a new incompatible format that is also COutPoint/Coin based. * Implements reconstruction code for hash_serialized_2. * Adapts the coins_tests unit tests (thanks to Russell Yanofsky). A side effect of the new CCoinsView model is that we can no longer use the (unreliable) test for transaction outputs in the UTXO set to determine whether we already have a particular transaction.
2017-05-26Report on-disk size in gettxoutsetinfoPieter Wuille
2017-05-23Fix: make CCoinsViewDbCursor::Seek work for missing keysPieter Wuille
Thanks to Suhas Daftuar for figuring this out.
2017-05-18Globals: Pass Consensus::Params through CBlockTreeDB::LoadBlockIndexGuts()Jorge Timón
2017-05-13Replace boost::function with std::function (C++11)practicalswift
2017-04-01Change LogAcceptCategory to use uint32_t rather than sets of strings.Gregory Maxwell
This changes the logging categories to boolean flags instead of strings. This simplifies the acceptance testing by avoiding accessing a scoped static thread local pointer to a thread local set of strings. It eliminates the only use of boost::thread_specific_ptr outside of lockorder debugging. This change allows log entries to be directed to multiple categories and makes it easy to change the logging flags at runtime (e.g. via an RPC, though that isn't done by this commit.) It also eliminates the fDebug global. Configuration of unknown logging categories now produces a warning.
2017-01-27Refactor: Remove using namespace <xxx> from src/*.cpp.Karl-Johan Alm
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-09-01C++11: s/boost::scoped_ptr/std::unique_ptr/Jorge Timón
2016-05-06Merge #7815: Break circular dependency main ↔ txdbWladimir J. van der Laan
99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
2016-04-23dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIteratorWladimir J. van der Laan
Pass parent wrapper directly instead of obfuscation key. This makes it possible for other databases which re-use this code to use other properties from the database. Add a namespace dbwrapper_private for private functions to be used only in dbwrapper.h/cpp and dbwrapper_tests.
2016-04-18txdb: Fix assert crash in new UTXO set cursorWladimir J. van der Laan
Remove the mistaken assumption that GetKey returning false signifies an internal database issue. It will return false when the key cannot be deserialized into the (char,uint256) stanza, which indicates that the cursor has reached a different kind of key. Fixes bug #7890 introduced in #7756.
2016-04-15Break circular dependency main ↔ txdbWladimir J. van der Laan
Break the circular dependency between main and txdb by: - Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes sense, as the other block-file stuff is there too. - Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems specific to txdb. - Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves it up to the caller how to insert block indices.
2016-04-15txdb: Add Cursor() method to CCoinsView to iterate over UTXO setWladimir J. van der Laan
Add a method Cursor() to CCoinsView that returns a cursor which can be used to iterate over the whole UTXO set. - rpc: Change gettxoutsetinfo to use new Cursor method - txdb: Remove GetStats method - Now that GetStats is implemented in terms of Cursor, remove it.
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-10-28Fix chainstate serialized_size computationPieter Wuille
2015-10-22leveldbwrapper symbol rename: Remove "Level" from class, etc. namesJeff Garzik
2015-10-13trivial: use constants for db keysDaniel Kraft
Replace literal occurances of the key "prefixes" 'c' and 'b' in txdb.cpp by the respective constants.
2015-10-09Refer to obfuscate_key via pointer in peripheral CLevelDB classesJames O'Beirne
cc @sipa
2015-10-08Handle obfuscation in CLevelDBIteratorJames O'Beirne
2015-10-08Encapsulate CLevelDB iterators cleanlyPieter Wuille
Conflicts: src/leveldb.cpp src/leveldb.h src/txdb.cpp
2015-10-06Add chainstate obfuscation to avoid spurious antivirus detectionJames O'Beirne
Adds an `obfuscate` parameter to `CLevelDBWrapper` and makes use of it for all new chainstate stores built via `CCoinsViewDB`. Also adds an `Xor` method to `CDataStream`. Thanks to @sipa @laanwj @pstratem @dexX7 @KyrosKrane @gmaxwell.
2015-07-23TRIVIAL: Missing includesJorge Timón
2015-06-16rpc: make `gettxoutsettinfo` run lock-freeWladimir J. van der Laan
For leveldb "An iterator operates on a snapshot of the database taken when the iterator is created". This means that it is unnecessary to lock out other threads while computing statistics, and neither to hold cs_main for the whole time. Let the thread run free.
2015-03-26Consensus: Refactor: Decouple pow.o from chainparams.oJorge Timón
2015-03-24Includes: Do not include main.h from any other headerJorge Timón
2015-01-31Remove whitespaces before double colon in errors and logsPavel Janík
2015-01-25change hardcoded character constants to a set of descriptive named constants ↵Earlz
for database keys
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19Merge pull request #5470Wladimir J. van der Laan
78253fc Remove references to X11 licence (Michael Ford)
2014-12-17make all catch() arguments constPhilip Kaufmann
- I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase