aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/berkeleydb/db_bdb.cpp
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-03-17 17:18:45 -0400
committerThomas Winget <tewinget@gmail.com>2015-03-17 17:18:45 -0400
commite146027acd3887f0cad9dea547cc74c608d5ec0b (patch)
tree71d7fbaa4f7f5cd0c5e8b3bb3906693980107f5f /src/blockchain_db/berkeleydb/db_bdb.cpp
parentBerkeleyDB Blockchain building, not working yet (diff)
downloadmonero-e146027acd3887f0cad9dea547cc74c608d5ec0b.tar.xz
BlockchainBDB passes unit tests
Diffstat (limited to 'src/blockchain_db/berkeleydb/db_bdb.cpp')
-rw-r--r--src/blockchain_db/berkeleydb/db_bdb.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp
index 6b510f51a..17208a787 100644
--- a/src/blockchain_db/berkeleydb/db_bdb.cpp
+++ b/src/blockchain_db/berkeleydb/db_bdb.cpp
@@ -122,6 +122,7 @@ struct Dbt_copy: public Dbt
{
set_data(&t_copy);
set_size(sizeof(T));
+ set_ulen(sizeof(T));
set_flags(DB_DBT_USERMEM);
}
@@ -141,6 +142,7 @@ struct Dbt_copy<cryptonote::blobdata>: public Dbt
memcpy(m_data.get(), bd.data(), bd.size());
set_data(m_data.get());
set_size(bd.size());
+ set_ulen(bd.size());
set_flags(DB_DBT_USERMEM);
}
private:
@@ -152,6 +154,7 @@ struct Dbt_safe : public Dbt
Dbt_safe()
{
set_data(NULL);
+ set_flags(DB_DBT_MALLOC);
}
~Dbt_safe()
{
@@ -1656,7 +1659,7 @@ uint64_t BlockchainBDB::add_block( const block& blk
{
m_num_outputs = num_outputs;
m_write_txn = NULL;
- throw0(DB_ERROR(std::string("Error adding block: ").append(e.what()).c_str()));
+ throw;
}
m_height++;