aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb
diff options
context:
space:
mode:
authorwarptangent <warptangent@tutanota.com>2016-03-04 11:58:30 -0800
committerHoward Chu <hyc@symas.com>2016-04-05 20:54:07 +0100
commit46b991b3629856b4d5c8c59fb18e7a55d23f78a1 (patch)
treeb27059ddfe40efe80151d6d19fcdbbe7567b1bc3 /src/blockchain_db/lmdb
parentSchema update: tx_indices - consolidate the tx subdbs from 5 to 3 (diff)
downloadmonero-46b991b3629856b4d5c8c59fb18e7a55d23f78a1.tar.xz
Use MDB_APPEND mode with two tx subdbs
This is possible on those using a tx index as a key.
Diffstat (limited to 'src/blockchain_db/lmdb')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index eaba95cad..f97c2209f 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -647,7 +647,7 @@ uint64_t BlockchainLMDB::add_transaction_data(const crypto::hash& blk_hash, cons
throw0(DB_ERROR(lmdb_error("Failed to add tx data to db transaction: ", result).c_str()));
MDB_val_copy<blobdata> blob(tx_to_blob(tx));
- result = mdb_cursor_put(m_cur_txs, &val_tx_index, &blob, 0);
+ result = mdb_cursor_put(m_cur_txs, &val_tx_index, &blob, MDB_APPEND);
if (result)
throw0(DB_ERROR(lmdb_error("Failed to add tx blob to db transaction: ", result).c_str()));
@@ -779,7 +779,7 @@ void BlockchainLMDB::add_amount_and_global_output_indices(const uint64_t tx_inde
v.mv_size = sizeof(uint64_t) * 2 * num_outputs;
// LOG_PRINT_L1("tx_outputs[tx_hash] size: " << v.mv_size);
- result = mdb_cursor_put(m_cur_tx_outputs, &k_tx_index, &v, 0);
+ result = mdb_cursor_put(m_cur_tx_outputs, &k_tx_index, &v, MDB_APPEND);
if (result)
throw0(DB_ERROR(std::string("Failed to add <tx hash, amount output index array> to db transaction: ").append(mdb_strerror(result)).c_str()));
}