aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/berkeleydb
Commit message (Collapse)AuthorAgeFilesLines
* blockchain_db: initialize m_open in base class ctormoneromooo-monero2018-02-021-1/+1
| | | | | | It's cleaner this way, since it's a base class field Coverity 136568
* Update 2018 copyrightxmr-eric2018-01-262-2/+2
|
* move includes around to lessen overall loadmoneromooo-monero2017-12-161-1/+1
|
* update copyright year, fix occasional lack of newline at line endRiccardo Spagni2017-02-212-2/+2
|
* extract some basic code from libcryptonote_core into libcryptonote_basickenshi842017-02-081-1/+1
|
* Use batch transactions when syncingHoward Chu2017-01-142-2/+3
| | | | | Faster throughput while avoiding corruption. I.e., makes running with --db-sync-mode safe more tolerable.
* core: faster find_blockchain_supplementmoneromooo-monero2016-08-312-2/+5
| | | | | | | | | | | | | Since this queries block heights for blocks that may or may not exist, queries for non existing blocks would throw an exception, and that would slow down the loop a lot. 7 seconds to go through a 30 hash list. Fix this by adding an optional return block height to block_exists and using this instead. Actual errors will still throw an exception. This also cuts down on log exception spam.
* move the rct commitments to the output_amounts databasemoneromooo-monero2016-08-282-2/+2
| | | | | | | | | | | | | | | | | | | Since these are needed at the same time as the output pubkeys, this is a whole lot faster, and takes less space. Only outputs of 0 amount store the commitment. When reading other outputs, a fake commitment is regenerated on the fly. This avoids having to rewrite the database to add space for fake commitments for existing outputs. This code relies on two things: - LMDB must support fixed size records per key, rather than per database (ie, all records on key 0 are the same size, all records for non 0 keys are same size, but records from key 0 and non 0 keys do have different sizes). - the commitment must be directly after the rest of the data in outkey and output_data_t.
* remove hf_starting_height dbmoneromooo-monero2016-07-132-30/+0
| | | | | | It's not really needed, it used to be an optimization for when that code was not using the db and needed to recalculate things fast on startup.
* add a --max-concurrency flagmoneromooo-monero2016-04-281-1/+1
| | | | | | It sets the max number of threads to use for a parallel job. This is different that the number of total threads, since monero binaries typically start a lot of them.
* New RPC and daemon command to get output histogrammoneromooo-monero2016-03-262-0/+15
| | | | | | | | | | | | | | | | | This is a list of existing output amounts along with the number of outputs of that amount in the blockchain. The daemon command takes: - no parameters: all outputs with at least 3 instances - one parameter: all outputs with at least that many instances - two parameters: all outputs within that many instances The default starts at 3 to avoid massive spamming of all dust outputs in the blockchain, and is the current minimum mixin requirement. An optional vector of amounts may be passed, to request histogram only for those outputs.
* Use boost::thread instead of std::threadHoward Chu2016-03-112-5/+5
| | | | and all other associated IPC
* Merge pull request #686Riccardo Spagni2016-02-292-2/+2
|\ | | | | | | | | | | | | | | 7db89ed ARMv7: fix unaligned accesses (Howard Chu) 5a07cef Wrap some more actions in a larger read txn (Howard Chu) 8cc7a36 read txn/cursor stuff (Howard Chu) 86a7f2b core: check whether an update is needed straight away (moneromooo-monero) ea5fa5e core: print "update needed" hard fork notifications in red (moneromooo-monero)
| * read txn/cursor stuffHoward Chu2016-02-232-2/+2
| | | | | | | | Could wrap more later.
* | db_bdb: add missing include for std::condition_variablemoneromooo-monero2016-02-201-0/+1
| |
* | BlockchainBDB: Check if hard fork subdbs need resetwarptangent2016-02-181-1/+50
| | | | | | | | See f7e337e6254c1c4115a8430964a6f6b54305b3ae for LMDB equivalent.
* | BlockchainBDB: Support blockchain_import --drop-hard-fork commandwarptangent2016-02-181-3/+35
|/ | | | See c657e772c4efbfee8ff698883f1532a38117a70a for LMDB equivalent.
* Shutup about VERSION 0Howard Chu2016-02-171-1/+3
|
* Make HardFork object available to BlockchainDB and derived DB implementationswarptangent2016-02-081-0/+2
| | | | | | This will later allow the HardFork object's DB update functions to be called when the DB transaction that persists across block add/remove is open.
* BlockchainDB/LMDB/BDB: Extract DB txn functions for block add/removewarptangent2016-02-082-0/+19
|
* blockchain_import: Add --drop-hard-fork commandwarptangent2016-02-082-0/+6
|
* berkeleydb: fix delete/free mismatchmoneromooo-monero2016-02-031-2/+2
| | | | | Despite being C++, the stats object is allocated by the underlying C layer using malloc(3).
* BlockchainBDB: Continue when tx has no outputswarptangent2016-01-281-3/+5
| | | | See 24b66243c2767726ea4b279fcf447c7cd82c13e5
* BlockchainBDB: When removing, find amount output index fast by starting at endwarptangent2016-01-281-10/+33
| | | | | | | | | This improves blockchain reorganization time by allowing one of the more expensive DB lookups when popping a block to not have to seek through a long dup list in the "output_amounts" db. This is most noticeable for HDDs. See ffcf6bdb95abe2dab37d5f8d9acc134fdc6b4d36
* BlockchainBDB: Remove tx outputs in reverse orderwarptangent2016-01-281-4/+14
| | | | | | | | | Data should be removed in the reverse order it was added. This matches the order of removal in blockchain_storage::pop_transaction_from_global_index. See f11def012f38106b0ffeb7010a2f749de1e5b640
* OpenBSD support for Monero.me0wmix2016-01-211-1/+3
|
* Fix hf when import with verify offHoward Chu2016-01-152-0/+6
| | | | Delete the hf tables, so the next open will rescan and regenerate
* fixed copyrights with bad year referencesRiccardo Spagni2015-12-312-2/+2
|
* BlockchainDB: skip fixup check if read-only databasewarptangent2015-12-262-0/+9
|
* db: throw when given a non txout_to_key output to addmoneromooo-monero2015-12-251-0/+4
| | | | | | The check was explicit in the original version, so it seems safer to make it explicit here, especially as it is now done implicitely in a different place, away from the original check.
* Add missing semicolons after log statementsmoneromooo-monero2015-12-191-3/+3
|
* Replace tabs with two spaces for consistency with rest of codebasewarptangent2015-12-151-14/+14
| | | | Remove trailing whitespace in same files.
* db_bdb: implement BlockchainBDB::resetmoneromooo-monero2015-12-131-1/+40
| | | | It is needed by the core tests
* db_bdb: create all needed directories, not just the leaf onemoneromooo-monero2015-12-131-1/+1
|
* Merge pull request #524Riccardo Spagni2015-12-081-3/+3
|\ | | | | | | 1c8262c db_bdb: move log_set_config call before open (moneromooo-monero)
| * db_bdb: move log_set_config call before openmoneromooo-monero2015-12-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a precaution for older Berkeley DB versions. - smooth reports an issue running with 4.7: DB_ENV->log_set_config: DB_LOG_IN_MEMORY: method not permitted after handle's open method - this works just fine with 5.3 - we do not use DB_LOG_IN_MEMORY, but we use DB_LOG_AUTO_REMOVE - libdb docs say some flags must be set before open, and some may be set at any time, but never say some must be set after open - moving the call to log_set_config before open works with 5.3 Therefore, it seems best to move the call before open.
* | Merge pull request #523Riccardo Spagni2015-12-081-0/+34
|\ \ | | | | | | | | | 8620b31 db_bdb: support for libdb without DB_FORCESYNC (moneromooo-monero)
| * | db_bdb: support for libdb without DB_FORCESYNCmoneromooo-monero2015-12-071-0/+34
| |/
* / blockchain_db: fixup missing key images in early DB versionmoneromooo-monero2015-12-062-0/+10
|/ | | | | | | | | | | Early DB versions did not store key images for inputs if the transaction spending them had no outputs (ie, all fee). This is not correct, as this would allow these outputs to be double spent. This was fixed in 533acc30eda7792c802ea8b6417917fa99b8bc2b a few months ago, but databases having synced blocks 2021612 and 685498 with a faulty version will be missing those key images in the spent keys database. This code checks for this, and adds those key images if they are missing.
* blockchain_db: make the indexing base a BlockchainDB virtual functionmoneromooo-monero2015-12-051-0/+2
|
* db_bdb: read 32 bit heights from keysmoneromooo-monero2015-12-041-1/+1
| | | | | Keys in Berkeley DB are 32 bits. We don't want to read random bits in the high part.
* Revert "db_bdb: record numbers for recno databases start at 1"moneromooo-monero2015-11-131-3/+3
| | | | | | | | | | It looks like some of the indices passed to the DB access functions are already bumped by 1. Moreover, the existing code was not throwing DB errors with 0 keys, and this is unlikely if it really was using 0 keys. Last, this patch broke sync from scratch in at least one case. So I'm calling it bad and reverting it. This reverts commit bfc97401ae81bb30278a318de7f048c653bf6582.
* Remove some old/obsolete/unused codemoneromooo-monero2015-10-272-28/+0
| | | | git history's here if needed to get any of this back
* db_bdb: add versioning, to detect incompatible format changesmoneromooo-monero2015-10-262-0/+83
|
* Add functions to iterate through blocks, txes, outputs, key imagesmoneromooo-monero2015-10-252-0/+125
|
* db_bdb: record numbers for recno databases start at 1moneromooo-monero2015-10-251-3/+3
|
* db_bdb: DB_KEYEMPTY is also not found for non-top recon fieldsmoneromooo-monero2015-10-251-2/+2
|
* blockchain_db: use the DNE exceptions where appropriatemoneromooo-monero2015-10-251-8/+10
|
* db_bdb: fix hard fork keysmoneromooo-monero2015-10-041-4/+4
| | | | | Berkeley DB requires RECNO keys to be 32 bits, and forbids a key value of 0.
* hardfork: most state now saved to the DBmoneromooo-monero2015-09-202-0/+85
| | | | | There will be a delay on first load of an existing blockchain as it gets reparsed for this state data.