summaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
Commit message (Collapse)AuthorAgeFilesLines
* also maybe do the block height this time, you know, just so that it actually ↵Riccardo Spagni2016-03-211-1/+1
| | | | works.
* also update the timestamp for the hard forkRiccardo Spagni2016-03-211-1/+1
|
* set fork date for September, add hyc's GPG key, remove aabramov'sRiccardo Spagni2016-03-211-0/+3
|
* Fix issue #706Howard Chu2016-03-191-0/+1
|
* Use boost::thread instead of std::threadHoward Chu2016-03-111-3/+3
| | | | and all other associated IPC
* Blockchain: Omit verbose time stats messages by defaultwarptangent2016-03-031-1/+1
| | | | | | | | | This is already the default for the daemon, but by checking a command line argument and calling a Blockchain member function setter. Initialize the variable to false so it's not dependent on an external command-line argument check. This allows utilities like blockchain_import to have a reasonable default without code changes.
* Wrap some more actions in a larger read txnHoward Chu2016-02-231-11/+25
|
* read txn/cursor stuffHoward Chu2016-02-231-0/+9
| | | | Could wrap more later.
* blockchain: initialize m_hardfork to NULLmoneromooo-monero2016-02-081-1/+1
| | | | It can now be set by some other code, and is thus tested
* core_tests: add tests for hard fork behaviors (MRL-0004)moneromooo-monero2016-02-081-5/+15
| | | | | | We also replace the --fakechain option with an optional structure containing details about configuration for the core/blockchain, for test purposes. This seems more future friendly.
* blockchain: reset hardfork object when resetting blockchainmoneromooo-monero2016-02-081-0/+1
| | | | | Not doing so will prevent the new genesis block from being reset if a switch past v1 had occured already.
* Blockchain: Update comments on removing blockwarptangent2016-02-081-0/+5
|
* Move HardFork DB update to BlockchainDB::add_block()warptangent2016-02-081-3/+0
| | | | | | | 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-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.
* Blockchain: Optionally pass in HardFork objectwarptangent2016-02-081-4/+20
|
* blockchain: revert handle_get_objects adding block id on tx not foundmoneromooo-monero2016-02-031-1/+0
| | | | | This differs from the original CN code, and there seems to be no reason to include the block itself, if it was found
* minor bugfixes and refactoringThomas Winget2016-02-021-56/+77
| | | | | | | | | | | - Blockchain should store if it's running on testnet or not - moved loading compiled-in block hashes to its own function for clarity - on handle_get_objects, should now correctly return false if a block's transactions are missing - replace instances of BOOST_FOREACH with C++11 for loops in Blockchain.
* Merge pull request #634Riccardo Spagni2016-01-311-0/+1
|\ | | | | | | | | 7fc6fa3 wallet: forbid dust altogether in output selection where appropriate (moneromooo-monero) 5e1a739 blockchain: log number of outputs available for a new tx (moneromooo-monero)
| * blockchain: log number of outputs available for a new txmoneromooo-monero2016-01-311-0/+1
| |
* | Merge pull request #631Riccardo Spagni2016-01-311-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | bcac101 daemon: fix a few issues reported by valgrind (moneromooo-monero) a7e8174 tx_pool: fix serialization of new relayed data (moneromooo-monero) 601ad76 hardfork: fix mixup in indexing variable in get_voting_info (moneromooo-monero) 444e22f blockchain: remove unused timer (moneromooo-monero) 7edfdd8 blockchain: fix m_sync_counter uninitialized variable use (moneromooo-monero) d97582c epee: use generate_random_bytes for new random uuids (moneromooo-monero) 17c7c9c epee: remove dodgy random code that nobody uses (moneromooo-monero)
| * | blockchain: remove unused timermoneromooo-monero2016-01-301-1/+0
| | |
| * | blockchain: fix m_sync_counter uninitialized variable usemoneromooo-monero2016-01-301-1/+1
| |/ | | | | | | It counts the number of blocks added since last zeroing
* / new flush_txpool command, and associated RPC callmoneromooo-monero2016-01-301-0/+19
|/ | | | | It can flush a particular tx, or the whole pool (the RPC command can flush a list of transactions too)
* Fix V1/V2 use of hard fork related parametersmoneromooo-monero2016-01-291-6/+13
| | | | | Some of it uses hardcoded height, which will need some thinking for next (voted upon) fork.
* updated copyright yearRiccardo Spagni2015-12-311-1/+1
|
* blockchain: kill ioservice on scope end, rather than manuallymoneromooo-monero2015-12-301-6/+7
| | | | | | This ensures this will be done without fail, as the error prone matching of every return with a call to KILL_IOSERVICE leads to hard to debug corruption when one is missing.
* Merge pull request #572Riccardo Spagni2015-12-301-0/+2
|\ | | | | | | | | | | | | 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)
| * blockchain: always stop the ioservice before returningmoneromooo-monero2015-12-281-0/+2
| | | | | | | | Fixes a use after free
* | blockchain: remove obsolete containersmoneromooo-monero2015-12-261-5/+1
| |
* | blockchain: Fix height in call to on_blockchain_decmoneromooo-monero2015-12-261-1/+1
|/ | | | It was a noop anyway
* blockchain: fix a few block addition bugsmoneromooo-monero2015-12-251-34/+45
| | | | | | | | | | | | | | | | | | | | | If the block reward was too high, the verification failed flag was set, but the function continued. The code which was supposed to trap this flag and return failure failed to trap it, and, while the block was not added to the chain, the function would return success. The reason for avoiding returning when the block reward problem was detected was to be able to return any transactions to the pool if needed. This is now mooted by moving the transaction return code to a separate function, which is now called at all appropriate points, making the logic much simpler, and hopefully correct now. We also move the hard fork version check after the prev_id check, as block which does not go on the top of the chain might not have the expected version there, without being invalid just for this reason. Last, we trap the case where a block fails to be added due to using already spent key images, to set the verification failed flag.
* blockchain: fix an off by one error in unlocked time checkmoneromooo-monero2015-12-251-1/+1
|
* blockchain: reinstate double spending checks in check_tx_inputsmoneromooo-monero2015-12-251-3/+7
| | | | | | This fixes some double spending tests. This may or may not be unneeded in normal (non test) circumstances, to be determined later. Keeping these for now may be slower, but safer.
* blockchain: make some flag twiddling code closer to the originalmoneromooo-monero2015-12-251-2/+2
| | | | Probably paranoid and unnecessary
* blockchain: fix bitflipping test with quantized block rewardsmoneromooo-monero2015-12-251-1/+4
| | | | | | | Block reward may now be less than the full amount allowed. This was breaking the bitflipping test. We now keep track of whether a block which was accepted by the core has a lower than allowed block reward, and allow this in the test.
* blockchain: add missing m_tx_pool.on_blockchain_decmoneromooo-monero2015-12-251-0/+1
| | | | | It was missing in the port to DB. This is actually a noop, so should not have functional changes.
* blockchain: fix switch to alternative blockchain for more than one blockmoneromooo-monero2015-12-251-1/+1
| | | | | When rolling over more than one block, the db height will decrease, but the split height should be constant, as per the original code.
* blockchain: add a missing validity check to rollback_blockchain_switchingmoneromooo-monero2015-12-251-0/+6
| | | | It was present in the original code
* core: catch exceptions from get_output_keymoneromooo-monero2015-12-251-2/+18
| | | | | This can happen when trying to find an amount that does not exist, and fixes a core test.
* db: throw when given a non txout_to_key output to addmoneromooo-monero2015-12-251-0/+5
| | | | | | 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.
* Allow the wallet to access hard fork informationmoneromooo-monero2015-12-191-2/+2
| | | | And make it change behavior slightly when close/after first hard fork
* Add missing semicolons after log statementsmoneromooo-monero2015-12-191-3/+3
|
* replace std::auto_ptr with std::unique_ptrmoneromooo-monero2015-12-171-1/+1
| | | | The former is obsolete
* Fix typowarptangent2015-12-151-1/+1
|
* blockchain.cpp: Change indentation from 4 to 2 spaceswarptangent2015-12-151-2193/+2191
|
* Replace tabs with two spaces for consistency with rest of codebasewarptangent2015-12-151-74/+74
| | | | Remove trailing whitespace in same files.
* Tone down a bit L0 logs during daemon syncmoneromooo-monero2015-12-141-1/+1
|
* add a --fakechain argument for testsmoneromooo-monero2015-12-131-4/+7
| | | | | | | | | | | The core tests use the blockchain, and reset it to be able to add test data to it. This does not play nice with the databases, since those will save that data without an explicit save call. We add a fakechain flag that the tests will set, which tells the core and blockchain code to use a separate database, as well as skip a few things like checkpoints and fixup, which only make sense for real data.
* blockchain: log block (not chain) height in "BLOCK SUCCESFULLY ADDED"moneromooo-monero2015-12-131-1/+1
| | | | | This makes it log the same height as the original code, which is less confusing when comparing behaviors.
* blockchain: fix off by one in get_blocksmoneromooo-monero2015-12-131-1/+1
|