aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwarptangent <warptangent@tutanota.com>2016-01-28 16:43:00 -0800
committerwarptangent <warptangent@tutanota.com>2016-01-28 21:15:46 -0800
commitb8cc6d46bdd4d916064c4678580eca91918bf82e (patch)
tree144666a0f0d40d6080a6e56f3aa12db2c4ad0705 /src
parentBlockchainBDB: When removing, find amount output index fast by starting at end (diff)
downloadmonero-b8cc6d46bdd4d916064c4678580eca91918bf82e.tar.xz
BlockchainBDB: Continue when tx has no outputs
See 24b66243c2767726ea4b279fcf447c7cd82c13e5
Diffstat (limited to 'src')
-rw-r--r--src/blockchain_db/berkeleydb/db_bdb.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp
index 46e12af88..832fb8f8d 100644
--- a/src/blockchain_db/berkeleydb/db_bdb.cpp
+++ b/src/blockchain_db/berkeleydb/db_bdb.cpp
@@ -354,9 +354,11 @@ void BlockchainBDB::remove_transaction_data(const crypto::hash& tx_hash, const t
remove_tx_outputs(tx_hash, tx);
- if (m_tx_outputs->del(DB_DEFAULT_TX, &val_h, 0))
+ auto result = m_tx_outputs->del(DB_DEFAULT_TX, &val_h, 0);
+ if (result == DB_NOTFOUND)
+ LOG_PRINT_L1("tx has no outputs to remove: " << tx_hash);
+ else if (result)
throw1(DB_ERROR("Failed to add removal of tx outputs to db transaction"));
-
}
void BlockchainBDB::add_output(const crypto::hash& tx_hash, const tx_out& tx_output, const uint64_t& local_index, const uint64_t unlock_time)
@@ -411,7 +413,7 @@ void BlockchainBDB::remove_tx_outputs(const crypto::hash& tx_hash, const transac
auto result = cur->get(&k, &v, DB_SET);
if (result == DB_NOTFOUND)
{
- throw0(OUTPUT_DNE("Attempting to remove a tx's outputs, but none found."));
+ LOG_PRINT_L2("tx has no outputs, so no global output indices");
}
else if (result)
{