mirror of
https://github.com/monero-project/monero.git
synced 2025-07-24 20:55:21 -04:00
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
This commit is contained in:
parent
2dc1cd9ae6
commit
d1eac1b71c
2 changed files with 17 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue