Skip to content

Commit

Permalink
Merge pull request #5413
Browse files Browse the repository at this point in the history
5fafb90 testdb: add override keyword where missing (stoffu)
  • Loading branch information
fluffypony committed Apr 17, 2019
2 parents 4609b36 + 5fafb90 commit e9464eb
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 138 deletions.
30 changes: 0 additions & 30 deletions src/blockchain_db/berkeleydb/db_bdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1654,36 +1654,6 @@ tx_out_index BlockchainBDB::get_output_tx_and_index(const uint64_t& amount, cons
return indices[0];
}

std::vector<uint64_t> BlockchainBDB::get_tx_output_indices(const crypto::hash& h) const
{
LOG_PRINT_L3("BlockchainBDB::" << __func__);
check_open();
std::vector<uint64_t> index_vec;

bdb_cur cur(DB_DEFAULT_TX, m_tx_outputs);

Dbt_copy<crypto::hash> k(h);
Dbt_copy<uint32_t> v;
auto result = cur->get(&k, &v, DB_SET);
if (result == DB_NOTFOUND)
throw1(OUTPUT_DNE("Attempting to get an output by tx hash and tx index, but output not found"));
else if (result)
throw0(DB_ERROR("DB error attempting to get an output"));

db_recno_t num_elems = 0;
cur->count(&num_elems, 0);

for (uint64_t i = 0; i < num_elems; ++i)
{
index_vec.push_back(v);
cur->get(&k, &v, DB_NEXT_DUP);
}

cur.close();

return index_vec;
}

std::vector<uint64_t> BlockchainBDB::get_tx_amount_output_indices(const crypto::hash& h) const
{
LOG_PRINT_L3("BlockchainBDB::" << __func__);
Expand Down
1 change: 0 additions & 1 deletion src/blockchain_db/berkeleydb/db_bdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ class BlockchainBDB : public BlockchainDB
virtual tx_out_index get_output_tx_and_index(const uint64_t& amount, const uint64_t& index);
virtual void get_output_tx_and_index(const uint64_t& amount, const std::vector<uint64_t> &offsets, std::vector<tx_out_index> &indices);

virtual std::vector<uint64_t> get_tx_output_indices(const crypto::hash& h) const;
virtual std::vector<uint64_t> get_tx_amount_output_indices(const crypto::hash& h) const;

virtual bool has_key_image(const crypto::key_image& img) const;
Expand Down
Loading

0 comments on commit e9464eb

Please sign in to comment.