aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb/db_lmdb.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-08-22 20:40:37 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-08-22 20:40:37 -0500
commit7e4507a04849fd2fd6da74e654a29de98717f685 (patch)
tree8c5684530c1fab6e71c149282cb98f2826c7b852 /src/blockchain_db/lmdb/db_lmdb.cpp
parentMerge pull request #4179 (diff)
parentblockchain_db: remove unused get_output_key variant (diff)
downloadmonero-7e4507a04849fd2fd6da74e654a29de98717f685.tar.xz
Merge pull request #4200
43f7110 blockchain_db: remove unused get_output_key variant (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db/lmdb/db_lmdb.cpp')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 627038ca7..983a0168a 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -2454,55 +2454,6 @@ uint64_t BlockchainLMDB::get_num_outputs(const uint64_t& amount) const
return num_elems;
}
-// This is a lot harder now that we've removed the output_keys index
-output_data_t BlockchainLMDB::get_output_key(const uint64_t &global_index) const
-{
- LOG_PRINT_L3("BlockchainLMDB::" << __func__ << " (unused version - does nothing)");
- check_open();
- TXN_PREFIX_RDONLY();
- RCURSOR(output_txs);
- RCURSOR(tx_indices);
-
- output_data_t od;
- MDB_val_set(v, global_index);
- auto get_result = mdb_cursor_get(m_cur_output_txs, (MDB_val *)&zerokval, &v, MDB_GET_BOTH);
- if (get_result == MDB_NOTFOUND)
- throw1(OUTPUT_DNE("output with given index not in db"));
- else if (get_result)
- throw0(DB_ERROR("DB error attempting to fetch output tx hash"));
-
- outtx *ot = (outtx *)v.mv_data;
-
- MDB_val_set(val_h, ot->tx_hash);
- get_result = mdb_cursor_get(m_cur_tx_indices, (MDB_val *)&zerokval, &val_h, MDB_GET_BOTH);
- if (get_result)
- throw0(DB_ERROR(lmdb_error(std::string("DB error attempting to fetch transaction index from hash ") + epee::string_tools::pod_to_hex(ot->tx_hash) + ": ", get_result).c_str()));
-
- txindex *tip = (txindex *)val_h.mv_data;
- MDB_val_set(val_tx_id, tip->data.tx_id);
- MDB_val result;
- get_result = mdb_cursor_get(m_cur_txs_pruned, &val_tx_id, &result, MDB_SET);
- if (get_result == MDB_NOTFOUND)
- throw1(TX_DNE(std::string("tx with hash ").append(epee::string_tools::pod_to_hex(ot->tx_hash)).append(" not found in db").c_str()));
- else if (get_result)
- throw0(DB_ERROR(lmdb_error("DB error attempting to fetch tx from hash", get_result).c_str()));
-
- blobdata bd;
- bd.assign(reinterpret_cast<char*>(result.mv_data), result.mv_size);
-
- transaction tx;
- if (!parse_and_validate_tx_base_from_blob(bd, tx))
- throw0(DB_ERROR("Failed to parse tx from blob retrieved from the db"));
-
- const tx_out tx_output = tx.vout[ot->local_index];
- od.unlock_time = tip->data.unlock_time;
- od.height = tip->data.block_id;
- od.pubkey = boost::get<txout_to_key>(tx_output.target).key;
-
- TXN_POSTFIX_RDONLY();
- return od;
-}
-
output_data_t BlockchainLMDB::get_output_key(const uint64_t& amount, const uint64_t& index)
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);