aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.h
Commit message (Collapse)AuthorAgeFilesLines
...
| * | add --regtest and --fixed-difficulty for regression testingvictorsintnicolaas2018-06-291-0/+14
| |/ | | | | | | | | | | | | on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest. Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'. Queries hard fork heights info of other network types
* / tx_pool: initialize bitflags padding since it gets written to storagemoneromooo-monero2018-06-051-0/+1
|/ | | | Avoids valgrind reporting uninitialized data usage
* db_lmdb: save pruned and prunable tx data separatelymoneromooo-monero2018-05-231-3/+33
| | | | This bumps DB version to 2, migration code will run for v1 DBs
* speed up get_output_distribution (and precalc common case)moneromooo-monero2018-05-211-0/+2
|
* speedup get_output_histogram for all amounts when min_count > 0moneromooo-monero2018-04-231-1/+2
| | | | | | This skips the vast majority of "dust" output amounts with just one instance on the chain. Clocks in at 0.15% of the original time on testnet.
* add RPC to get a histogram of outputs of a given amountmoneromooo-monero2018-03-161-1/+3
|
* blockchain_db: initialize m_open in base class ctormoneromooo-monero2018-02-021-0/+5
| | | | | | It's cleaner this way, since it's a base class field Coverity 136568
* Update 2018 copyrightxmr-eric2018-01-261-1/+1
|
* Fix exceptions not finding txpool txes when relayingmoneromooo-monero2017-12-201-2/+3
|
* move includes around to lessen overall loadmoneromooo-monero2017-12-161-1/+1
|
* Merge pull request #2615Riccardo Spagni2017-11-141-2/+2
|\ | | | | | | 10013e94 Protect node privacy by proper filtering in restricted-mode RPC answers (binaryFate)
| * Protect node privacy by proper filtering in restricted-mode RPC answersbinaryFate2017-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to filter out sensitive information for queries that rely on the pool state, when running in restricted mode. This filtering is only applied to data sent back to RPC queries. Results of inline commands typed locally in the daemon are not affected. In practice, when running with `--restricted-rpc`: * get_transaction_pool will list relayed transactions with the fields "last relayed time" and "received time" set to zero. * get_transaction_pool will not list transaction that have do_not_relay set to true, and will not list key images that are used only for such transactions * get_transaction_pool_hashes.bin will not list such transaction * get_transaction_pool_stats will not count such transactions in any of the aggregated values that are computed The implementation does not make filtering the default, so developers should be mindful of this if they add new RPC functionality. Fixes #2590.
* | track double spending in the txpoolmoneromooo-monero2017-11-061-1/+2
|/ | | | | | | | | | | | | | Transactions in the txpool are marked when another transaction is seen double spending one or more of its inputs. This is then exposed wherever appropriate. Note that being marked with this "double spend seen" flag does NOT mean this transaction IS a double spend and will never be mined: it just means that the network has seen at least another transaction spending at least one of the same inputs, so care should be taken to wait for a few confirmations before acting upon that transaction (ie, mostly of use for merchants wanting to accept unconfirmed transactions).
* Use actual batch size for resize estimatesHoward Chu2017-09-171-1/+1
| | | | | | | And optimize import startup: Remember start_height position during initial count_blocks pass to avoid having to reread entire file again to arrive at start_height
* move db specific options to BlockchainDBmoneromooo-monero2017-08-291-0/+11
| | | | | Avoids common depending on blockchain_db, which can cause link errors.
* Toggle SAFE syncmode on and off automaticallyHoward Chu2017-08-201-0/+7
| | | | | | | | | If monerod is started with default sync mode, set it to SAFE after synchronization completes. Set it back to FAST if synchronization restarts (e.g. because another peer has a longer blockchain). If monerod is started with an explicit sync mode, none of this automation takes effect.
* DB cleanupHoward Chu2017-08-191-0/+7
| | | | | Hide LMDB-specific stuff behind blockchain_db.h. Nobody besides blockchain_db.cpp should ever be including DB-specific headers any more.
* blockchain_db: add a txpool tx getter which returns existencemoneromooo-monero2017-06-111-0/+10
| | | | Avoids exception spam for the "nope, not found" case
* Don't copy blockchain for coinbase_tx_sumHoward Chu2017-06-011-4/+6
| | | | | Changed Blockchain::for_all_blocks() to for_blocks_range() Operate on blockchain in-place instead of building a copy first.
* Move txpool to the databasemoneromooo-monero2017-05-251-0/+86
| | | | | | | Integration could go further (ie, return_tx_to_pool calls should not be needed anymore, possibly other things). poolstate.bin is now obsolete.
* fix dependency: put HardFork back to cryptonote_basic, made some ↵kenshi842017-03-101-5/+5
| | | | BlockchainDB functions virtual again to avoid missing symbols error
* core: move hardfork back to cryptonote_coremoneromooo-monero2017-02-251-1/+1
| | | | | should fix a cross dependency betewen cryptonote_basic and blockchain_db
* update copyright year, fix occasional lack of newline at line endRiccardo Spagni2017-02-211-1/+1
|
* Merge pull request #1727Riccardo Spagni2017-02-211-8/+42
|\ | | | | | | 0288310e blockchain_db: add "raw" blobdata getters for block and transaction (moneromooo-monero)
| * blockchain_db: add "raw" blobdata getters for block and transactionmoneromooo-monero2017-02-131-8/+42
| | | | | | | | This speeds up operations such as serving blocks to syncing peers
* | blockchain_db: do not throw on expected partial results getting keysmoneromooo-monero2017-02-131-1/+1
|/ | | | | | | | | When scanning for outputs used in a set of incoming blocks, we expect that some of the inputs in their transactions will not be found in the blockchain, as they could be in previous blocks in that set. Those outputs will be scanned there at a later point. In this case, we add a flag to control wehther an output not being found is expected or not.
* extract some basic code from libcryptonote_core into libcryptonote_basickenshi842017-02-081-3/+3
|
* Merge pull request #1506Riccardo Spagni2017-01-151-4/+5
|\ | | | | | | | | | | | | | | 3ff54bdd Check for correct thread before ending batch transaction (Howard Chu) eaf8470b Must wait for previous batch to finish before starting new one (Howard Chu) c903c554 Don't cache block height, always get from DB (Howard Chu) eb1fb601 Tweak default db-sync-mode to fast:async:1 (Howard Chu) 0693cff9 Use batch transactions when syncing (Howard Chu)
| * Use batch transactions when syncingHoward Chu2017-01-141-4/+5
| | | | | | | | | | Faster throughput while avoiding corruption. I.e., makes running with --db-sync-mode safe more tolerable.
* | blockchain: allow marking "tx not found" without an exceptionmoneromooo-monero2017-01-071-0/+14
|/ | | | | This is a normal occurence in many cases, and there is no need to spam the log with those when it is.
* wallet: select part of the fake outs from recent outputsmoneromooo-monero2016-10-151-1/+2
| | | | | | | 25% of the outputs are selected from the last 5 days (if possible), in order to avoid the common case of sending recently received outputs again. 25% and 5 days are subject to review later, since it's just a wallet level change.
* core: faster find_blockchain_supplementmoneromooo-monero2016-08-311-1/+2
| | | | | | | | | | | | | 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-281-34/+3
| | | | | | | | | | | | | | | | | | | 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.
* blockchain_db: add functions for adding/removing/getting rct commitmentsmoneromooo-monero2016-08-281-0/+33
|
* new unlocked parameter to output_histogrammoneromooo-monero2016-08-011-3/+4
| | | | | | | | This constrains the number of instances of any amount to the unlocked ones (as defined by the default unlock time setting: outputs with non default unlock time are not considered, so may be counted as unlocked even if they are not actually unlocked).
* remove hf_starting_height dbmoneromooo-monero2016-07-131-21/+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.
* Another take on migrationHoward Chu2016-04-241-12/+12
| | | | | Delete old indices and recreate them, rather than updating them Maybe not quite as slow as before.
* Merge branch 'performance' into masterHoward Chu2016-04-051-30/+64
|\
| * CleanupHoward Chu2016-04-051-3/+0
| | | | | | | | | | drop obsolete remove_output() fix get_output_key(global), fix crash in blockchain_dump
| * Cleanup and clarifyHoward Chu2016-04-051-24/+34
| | | | | | | | Try to rationalize the variable names, document usage.
| * Schema update: tx_indices - consolidate the tx subdbs from 5 to 3warptangent2016-04-051-0/+9
| |
| * Schema update: tx_indices - yet less indirectionwarptangent2016-04-051-2/+2
| |
| * Schema update: tx_indices - improve further with less indirectionwarptangent2016-04-051-2/+3
| |
| * Update schema for "tx_outputs" to use array containing amount output indiceswarptangent2016-04-051-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This speeds up wallet refresh by directly retrieving a tx's amount output indices. It removes the indirection and walking the amount output duplicate list for every amount in each requested tx. "tx_outputs" is used by: Amount output indices are needed for wallet refresh. Global output indices are needed for removing a tx. Both amount output indices and global output indices are now stored in an array of 64-bit unsigned ints: tx_outputs[<tx_hash>] -> [ <a1_oi, a1_gi, a2_oi, a2_gi, ...> ] Previously it was: tx_outputs[<tx_hash>] -> duplicate list of <a1_gi, a2_gi, a3_gi, ...> The amount output list had to be walked for every amount in order to find each amount's output index, by comparing the amount's global output index with each one in the duplicate list until a match was found. See also d045dfa7ce0bf131681193c97560da26f9f37900
* | New RPC and daemon command to get output histogrammoneromooo-monero2016-03-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #749Riccardo Spagni2016-03-251-155/+937
| | | | | | | | | | | | | | | | | | | | | | | | | | bfd4a28 Update BlockchainDB documentation (Thomas Winget) 797357e Change Doxyfile, Blockchain not blockchain_storage (Thomas Winget) c835215 remove defunct code from cryptonote::core (Thomas Winget) 50dba6d cryptonote::core doxygen documentation (Thomas Winget) 8ac329d doxygen documentation for difficulty functions (Thomas Winget) 540a76c Move checkpoint functions into checkpoints class (Thomas Winget) 1b0c98e doxygen documentation for checkpoints.{h,cpp} (Thomas Winget) 89c24ac Remove unnecessary or defunct code (Thomas Winget) ab0ed14 doxygen include private and static members (Thomas Winget) 3a48449 Updated documentation for blockchain.* (Thomas Winget)
* | Revert "Merge pull request #749"Riccardo Spagni2016-03-251-937/+155
| | | | | | | | | | This reverts commit 7fa63a82a1c3a0243f6757c1689855ed3ca61695, reversing changes made to cb6be986c36b78eddb4b7f16e9ad440af8567dc4.
* | Update BlockchainDB documentationThomas Winget2016-03-241-155/+937
| | | | | | | | | | BlockchainDB is now Doxygen-compliant and its documentation is up-to-date with recent changes.
* | Revert "Print stack trace upon exceptions"moneromooo-monero2016-03-211-2/+1
| | | | | | | | | | | | Ain't nobody got time for link/cmake skullduggery. This reverts commit fff238ec94ac6d45fc18c315d7bc590ddfaad63d.
* | Print stack trace upon exceptionsmoneromooo-monero2016-03-191-1/+2
|/ | | | Useful for debugging users' logs