BlockchainBDB: Continue when tx has no outputs

See 24b66243c2
This commit is contained in:
warptangent 2016-01-28 16:43:00 -08:00
parent b8707466e2
commit b8cc6d46bd
No known key found for this signature in database
GPG key ID: 0E490BEBFBE4E92D

View file

@ -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)
{