aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #686Riccardo Spagni2016-02-296-185/+340
|\ | | | | | | | | | | | | | | 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)
| * ARMv7: fix unaligned accessesHoward Chu2016-02-251-20/+15
| | | | | | | | And cleanup some key comparators
| * read txn/cursor stuffHoward Chu2016-02-236-165/+325
| | | | | | | | 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.
* Use MDB_PREV_MULTIPLEHoward Chu2016-02-171-11/+40
| | | | in get_global_output_indices
* Fixup after lmdb master resyncHoward Chu2016-02-171-6/+6
|
* Shutup about VERSION 0Howard Chu2016-02-172-2/+6
|
* Use cursor in get_output_keyHoward Chu2016-02-171-1/+2
|
* Use MDB_APPEND mode where possibleHoward Chu2016-02-171-5/+9
| | | | | | | | | When keys are contiguous and monotonically increasing, this gets denser page utilization (doesn't leave padding in page splits). Can't be used for keys that are inserted in random order (e.g. hashes) In total this only saves around 1.5% of space compared to original DB code. The previous patch accounted for 0.8% savings on its own; the blocks tables just aren't that big.
* Use cursors in write txnsHoward Chu2016-02-172-22/+100
| | | | | Saves a bit of seek overhead. LMDB frees them automatically in txn_(commit|abort) so they need no cleanup.
* Keep a running blocksize countHoward Chu2016-02-172-0/+15
| | | | | Used in batch size estimation, avoids rereading already processed blocks during import
* Win32 import batchsize tweaksHoward Chu2016-02-171-3/+6
| | | | | Reduce frequency of resizes: bump minimum increase from 128MB to 512MB Use a bigger safety margin at small batch sizes
* Merge pull request #657Riccardo Spagni2016-02-132-12/+50
|\ | | | | | | | | | | | | 1995923 BlockchainLMDB: Deal with DB exceptions at block level with particularity (warptangent) c16cc20 BlockchainLMDB: Add sanity check for inconsistent state (warptangent) 9118d0a BlockchainLMDB: Call destructor on allocated txn if setup fails (warptangent) f5581c3 BlockchainLMDB: Replace remaining txn pointer NULLs with nullptr (warptangent)
| * BlockchainLMDB: Deal with DB exceptions at block level with particularitywarptangent2016-02-132-2/+21
| | | | | | | | | | | | | | | | Add another DB error exception type to distinguish failed txn setup from general use of txn. This keeps the error handling flow the same as before the block-level txn setup changes that moved control up a layer to BlockchainDB.
| * BlockchainLMDB: Add sanity check for inconsistent statewarptangent2016-02-131-2/+13
| | | | | | | | | | This hasn't been known to occur in block-level txn abort, but throw exception if it does.
| * BlockchainLMDB: Call destructor on allocated txn if setup failswarptangent2016-02-131-0/+8
| |
| * BlockchainLMDB: Replace remaining txn pointer NULLs with nullptrwarptangent2016-02-131-9/+9
| | | | | | | | For consistency.
* | blockchain_db: pass hard fork object as a simple pointermoneromooo-monero2016-02-082-2/+2
|/
* Move HardFork DB update to BlockchainDB::add_block()warptangent2016-02-081-0/+1
| | | | | | | Ensures the database is consistent. Also simplifes blockchain_import in that verify mode off has less to work around.
* Make HardFork object available to BlockchainDB and derived DB implementationswarptangent2016-02-084-0/+16
| | | | | | 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: Refactor block-scope DB txn handling for add blockwarptangent2016-02-082-20/+10
| | | | Move block-scope txn start and stop from BlockchainLMDB to BlockchainDB.
* BlockchainDB/LMDB/BDB: Extract DB txn functions for block add/removewarptangent2016-02-085-0/+65
|
* BlockchainLMDB: Allow two HardFork functions to update DB during block addwarptangent2016-02-081-4/+4
| | | | Note that this doesn't yet cause them to be called during block add.
* BlockchainLMDB: extract txn macros used during block add/removewarptangent2016-02-081-0/+26
|
* fake_core: Check if hard fork subdbs need reset at startwarptangent2016-02-081-2/+8
|
* blockchain_import: Add --drop-hard-fork commandwarptangent2016-02-085-0/+21
|
* 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
|
* db_lmdb: Continue when tx has no outputswarptangent2016-01-191-4/+6
|
* Fix hf when import with verify offHoward Chu2016-01-155-0/+29
| | | | Delete the hf tables, so the next open will rescan and regenerate
* updated copyright yearRiccardo Spagni2015-12-311-1/+1
|
* fixed copyrights with bad year referencesRiccardo Spagni2015-12-317-7/+7
|
* Merge pull request #572Riccardo Spagni2015-12-301-3/+9
|\ | | | | | | | | | | | | b39aae7 Tweak 45800a25e9374e63caaabba05c89585c86acd668 (hyc) 4a5a5ff blockchain: always stop the ioservice before returning (moneromooo-monero) 78b65cf db_lmdb: safety close db at exit (moneromooo-monero) 45800a2 db_lmdb: fix a strdup/delete[] mistmatch (moneromooo-monero)
| * Tweak 45800a25e9374e63caaabba05c89585c86acd668hyc2015-12-291-5/+5
| | | | | | | | trivial cleanup
| * db_lmdb: safety close db at exitmoneromooo-monero2015-12-281-0/+3
| | | | | | | | | | | | Noticed by hyc Also set m_open to false when closed
| * db_lmdb: fix a strdup/delete[] mistmatchmoneromooo-monero2015-12-281-3/+6
| |
* | BlockchainDB: skip fixup check if read-only databasewarptangent2015-12-266-0/+32
|/
* Merge pull request #565Riccardo Spagni2015-12-262-0/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 79beed2 tests: fix various tests by using parameters better suited to monero (moneromooo-monero) d0a8362 tests: fix some double spending tests (moneromooo-monero) 2358d0d tests: use 255 as a "too high" block version (moneromooo-monero) f33a88c blockchain: fix a few block addition bugs (moneromooo-monero) a9ff11c blockchain: fix an off by one error in unlocked time check (moneromooo-monero) f294be3 blockchain: reinstate double spending checks in check_tx_inputs (moneromooo-monero) 737b6d6 blockchain: make some flag twiddling code closer to the original (moneromooo-monero) 81cb0fc blockchain: fix bitflipping test with quantized block rewards (moneromooo-monero) 22ddf09 blockchain: add missing m_tx_pool.on_blockchain_dec (moneromooo-monero) d837c0c blockchain: fix switch to alternative blockchain for more than one block (moneromooo-monero) 5cec076 blockchain: add a missing validity check to rollback_blockchain_switching (moneromooo-monero) 3cabdb5 core: catch exceptions from get_output_key (moneromooo-monero) 5eef645 db: throw when given a non txout_to_key output to add (moneromooo-monero)
| * db: throw when given a non txout_to_key output to addmoneromooo-monero2015-12-252-0/+8
| | | | | | | | | | | | 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.
* | BlockchainDB: Remove txs in reverse orderwarptangent2015-12-241-3/+5
| | | | | | | | | | | | | | | | Data should be removed in the reverse order it was added. Not doing so breaks assumptions and can cause problems in other DB implementations. This matches the order of tx removal in blockchain_storage::purge_block_data_from_blockchain.
* | BlockchainLMDB: When removing, find amount output index fast by starting at endwarptangent2015-12-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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" subdb. This is most noticeable for HDDs. As before, the dup list is still walked if necessary (but in reverse), and the global output index still confirmed to be the one looked for. But under proper use, the result will be found at the end of the dup list, so we start there. Removing an amount output index is always done in the context of popping a block, so the global output index being looked for should be the last one in that amount key's dup list. Even if the txs themselves aren't removed in reverse order (supposed to be according to original implementation), the specified amount output index will still be near the end, because the txs are in the same block. TEST: Pop blocks with blockchain_import. Blocks should be successfully removed with no errors shown. bitmonerod should be able to start syncing from the reduced blockchain height.
* | BlockchainLMDB: Remove tx outputs in reverse orderwarptangent2015-12-241-5/+5
|/ | | | | | | 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.
* Add missing semicolons after log statementsmoneromooo-monero2015-12-191-3/+3
|
* Replace tabs with two spaces for consistency with rest of codebasewarptangent2015-12-154-265/+265
| | | | Remove trailing whitespace in same files.
* db_lmdb: always use a batch tx if possiblemoneromooo-monero2015-12-141-290/+127
| | | | | | Also wrap that code in two prefix/suffix macros so they are easier to use and not forget. Also add consts to returned data casts where applicable.