diff options
author | warptangent <warptangent@inbox.com> | 2015-05-16 19:27:26 -0700 |
---|---|---|
committer | warptangent <warptangent@inbox.com> | 2015-05-16 19:38:52 -0700 |
commit | d1eac1b71cf9315487494be1ae460bb77a3a9207 (patch) | |
tree | fbc091d9382711aae51f1b2eb63a4c212ece0715 /src/cryptonote_core | |
parent | Merge pull request #286 (diff) | |
download | monero-d1eac1b71cf9315487494be1ae460bb77a3a9207.tar.xz |
Support debugging command --pop-blocks on in-memory blockchain
Add public method blockchain_storage::debug_pop_block_from_blockchain()
Ensure blockchain_import calls destructors before exit.
To test:
DATABASE=memory make release
// create blockchain.bin from blockchain.raw if needed
build/release/bin/blockchain_import --block-stop 1000
// try popping a single block
build/release/bin/blockchain_import --pop-blocks 1
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/blockchain_storage.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain_storage.h b/src/cryptonote_core/blockchain_storage.h index 50a62a428..2c2fb5250 100644 --- a/src/cryptonote_core/blockchain_storage.h +++ b/src/cryptonote_core/blockchain_storage.h @@ -190,6 +190,9 @@ namespace cryptonote difficulty_type get_block_cumulative_difficulty(uint64_t height) const { return m_blocks[height].cumulative_difficulty; } uint64_t get_block_coins_generated(uint64_t height) const { return m_blocks[height].already_generated_coins; } + // use for testing only + bool debug_pop_block_from_blockchain() { return pop_block_from_blockchain(); } + private: typedef std::unordered_map<crypto::hash, size_t> blocks_by_id_index; typedef std::unordered_map<crypto::hash, transaction_chain_entry> transactions_container; |