lmdb_db_open(txn,LMDB_SPENT_KEYS,MDB_INTEGERKEY|MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED,m_spent_keys,"Failed to open db handle for m_spent_keys");
lmdb_db_open(txn,LMDB_RCT_COMMITMENTS,MDB_INTEGERKEY|MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED,m_rct_commitments,"Failed to open db handle for m_rct_commitments");
// this subdb is dropped on sight, so it may not be present when we open the DB.
// Since we use MDB_CREATE, we'll get an exception if we open read-only and it does not exist.
// So we don't open for read-only, and also not drop below. It is not used elsewhere.
@ -1250,6 +1256,8 @@ void BlockchainLMDB::reset()
throw0(DB_ERROR(lmdb_error("Failed to drop m_output_amounts: ",result).c_str()));
if(autoresult=mdb_drop(txn,m_spent_keys,0))
throw0(DB_ERROR(lmdb_error("Failed to drop m_spent_keys: ",result).c_str()));
if(autoresult=mdb_drop(txn,m_rct_commitments,0))
throw0(DB_ERROR(lmdb_error("Failed to drop m_rct_commitments: ",result).c_str()));
(void)mdb_drop(txn,m_hf_starting_heights,0);// this one is dropped in new code
if(autoresult=mdb_drop(txn,m_hf_versions,0))
throw0(DB_ERROR(lmdb_error("Failed to drop m_hf_versions: ",result).c_str()));
throw0(OUTPUT_DNE(lmdb_error("Error attempting to retrieve rct commitment for "+boost::lexical_cast<std::string>(idx)+" from the db: ",result).c_str()));
elseif(result)
throw0(DB_ERROR(lmdb_error("Error attempting to retrieve rct commitment for "+boost::lexical_cast<std::string>(idx)+" from the db: ",result).c_str()));
throw0(OUTPUT_DNE(lmdb_error("Error attempting to retrieve rct commitment for "+boost::lexical_cast<std::string>(idx)+" from the db: ",result).c_str()));
elseif(result)
throw0(DB_ERROR(lmdb_error("Error attempting to retrieve rct commitment for "+boost::lexical_cast<std::string>(idx)+" from the db: ",result).c_str()));
result=mdb_cursor_del(m_cur_rct_commitments,0);
if(result)
throw0(DB_ERROR(lmdb_error("Error attempting to remove rct commitment for "+boost::lexical_cast<std::string>(idx)+" from the db: ",result).c_str()));