LOG_PRINT_L0("Unexpected: global output index not found in m_output_txs");
}
elseif(result)
{
throw1(DB_ERROR(lmdb_error("Error adding removal of output tx to db transaction",result).c_str()));
}
result=mdb_cursor_del(m_cur_output_txs,0);
if(result)
throw0(DB_ERROR(lmdb_error(std::string("Error deleting output index ").append(boost::lexical_cast<std::string>(out_index).append(": ")).c_str(),result).c_str()));
// now delete the amount
result=mdb_cursor_del(m_cur_output_amounts,0);
if(result)
throw0(DB_ERROR(lmdb_error(std::string("Error deleting amount for output index ").append(boost::lexical_cast<std::string>(output_index).append(": ")).c_str(),result).c_str()));
throw0(DB_ERROR(lmdb_error(std::string("Error deleting amount for output index ").append(boost::lexical_cast<std::string>(out_index).append(": ")).c_str(),result).c_str()));
// uses macros to avoid having to change things too many places
lmdb_db_open(txn,LMDB_BLOCKS,MDB_INTEGERKEY|MDB_CREATE,m_blocks,"Failed to open db handle for m_blocks");
lmdb_db_open(txn,LMDB_BLOCK_INFO,MDB_INTEGERKEY|MDB_CREATE,m_block_info,"Failed to open db handle for m_block_info");
lmdb_db_open(txn,LMDB_BLOCK_INFO,MDB_INTEGERKEY|MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED,m_block_info,"Failed to open db handle for m_block_info");
lmdb_db_open(txn,LMDB_BLOCK_HEIGHTS,MDB_INTEGERKEY|MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED,m_block_heights,"Failed to open db handle for m_block_heights");
lmdb_db_open(txn,LMDB_TXS,MDB_INTEGERKEY|MDB_CREATE,m_txs,"Failed to open db handle for m_txs");
lmdb_db_open(txn,LMDB_TX_INDICES,MDB_INTEGERKEY|MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED,m_tx_indices,"Failed to open db handle for m_tx_indices");
lmdb_db_open(txn,LMDB_TX_OUTPUTS,MDB_INTEGERKEY|MDB_CREATE,m_tx_outputs,"Failed to open db handle for m_tx_outputs");
lmdb_db_open(txn,LMDB_OUTPUT_TXS,MDB_INTEGERKEY|MDB_CREATE,m_output_txs,"Failed to open db handle for m_output_txs");
lmdb_db_open(txn,LMDB_OUTPUT_TXS,MDB_INTEGERKEY|MDB_CREATE|MDB_DUPSORT|MDB_DUPFIXED,m_output_txs,"Failed to open db handle for m_output_txs");
lmdb_db_open(txn,LMDB_OUTPUT_AMOUNTS,MDB_INTEGERKEY|MDB_DUPSORT|MDB_DUPFIXED|MDB_CREATE,m_output_amounts,"Failed to open db handle for m_output_amounts");
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");
throw0(BLOCK_DNE(std::string("Attempt to get timestamp from height ").append(boost::lexical_cast<std::string>(height)).append(" failed -- timestamp not in db").c_str()));
throw0(BLOCK_DNE(std::string("Attempt to get block size from height ").append(boost::lexical_cast<std::string>(height)).append(" failed -- block size not in db").c_str()));
throw0(BLOCK_DNE(std::string("Attempt to get cumulative difficulty from height ").append(boost::lexical_cast<std::string>(height)).append(" failed -- difficulty not in db").c_str()));
throw0(BLOCK_DNE(std::string("Attempt to get generated coins from height ").append(boost::lexical_cast<std::string>(height)).append(" failed -- block size not in db").c_str()));
throw0(BLOCK_DNE(std::string("Attempt to get hash from height ").append(boost::lexical_cast<std::string>(height)).append(" failed -- hash not in db").c_str()));