diff options
author | Thomas Winget <tewinget@gmail.com> | 2015-01-12 14:24:18 -0500 |
---|---|---|
committer | Thomas Winget <tewinget@gmail.com> | 2015-01-12 14:24:18 -0500 |
commit | d43782f04124c3bcabfb4902ca27ee460c6563b2 (patch) | |
tree | 5fa2c9f939cfbe73d65097577939cc560bd5d925 /src/cryptonote_core/blockchain_db.cpp | |
parent | Merge pull request #20 from warptangent/fix_transfers (diff) | |
parent | Fix height assertion in Blockchain::handle_alternative_block() (diff) | |
download | monero-d43782f04124c3bcabfb4902ca27ee460c6563b2.tar.xz |
Merge pull request #21 from warptangent/fix_block_reorg
Fixes and additions for block reorganization
Diffstat (limited to 'src/cryptonote_core/blockchain_db.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain_db.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain_db.cpp b/src/cryptonote_core/blockchain_db.cpp index 439cf5ded..5e781af79 100644 --- a/src/cryptonote_core/blockchain_db.cpp +++ b/src/cryptonote_core/blockchain_db.cpp @@ -107,6 +107,9 @@ void BlockchainDB::remove_transaction(const crypto::hash& tx_hash) { transaction tx = get_tx(tx_hash); + // TODO: This loop calling remove_output() should be removed. It doesn't do + // anything (function is empty), and the outputs were already intended to be + // removed later as part of remove_transaction_data(). for (const tx_out& tx_output : tx.vout) { remove_output(tx_output); @@ -120,7 +123,8 @@ void BlockchainDB::remove_transaction(const crypto::hash& tx_hash) } } - remove_transaction_data(tx_hash); + // need tx as tx.vout has the tx outputs, and the output amounts are needed + remove_transaction_data(tx_hash, tx); } } // namespace cryptonote |