Complete implementation of transaction removal

Complete method BlockchainLMDB::remove_output()
  - use output index as the key for:
    m_output_indices, m_output_txs, m_output_keys
  - call new method BlockchainLMDB::remove_amount_output_index()

Add method to remove amount output index.
  - BlockchainLMDB::remove_amount_output_index()
  - for m_output_amounts

This also fixes the segfault when blockchain reorganization is
attempted.
This commit is contained in:
warptangent
2015-01-11 18:04:04 -08:00
parent 1701c26750
commit 4d0a94b20c
4 changed files with 99 additions and 25 deletions
+1 -1
View File
@@ -274,7 +274,7 @@ private:
virtual void add_transaction_data(const crypto::hash& blk_hash, const transaction& tx) = 0;
// tells the subclass to remove data about a transaction
virtual void remove_transaction_data(const crypto::hash& tx_hash) = 0;
virtual void remove_transaction_data(const crypto::hash& tx_hash, const transaction& tx) = 0;
// tells the subclass to store an output
virtual void add_output(const crypto::hash& tx_hash, const tx_out& tx_output, const uint64_t& local_index) = 0;