Skip to content

Commit

Permalink
Version fix and more 202162 remnants
Browse files Browse the repository at this point in the history
  • Loading branch information
StelliteCoin committed Feb 2, 2018
1 parent 84165e4 commit e9a0d16
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 61 deletions.
7 changes: 0 additions & 7 deletions src/blockchain_db/berkeleydb/db_bdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,11 +2334,4 @@ bool BlockchainBDB::is_read_only() const
return false;
}

void BlockchainBDB::fixup()
{
LOG_PRINT_L3("BlockchainBDB::" << __func__);
// Always call parent as well
BlockchainDB::fixup();
}

} // namespace cryptonote
4 changes: 0 additions & 4 deletions src/blockchain_db/berkeleydb/db_bdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,6 @@ class BlockchainBDB : public BlockchainDB

virtual bool is_read_only() const;

//
// fix up anything that may be wrong due to past bugs
virtual void fixup();

bool m_run_checkpoint;
std::unique_ptr<boost::thread> m_checkpoint_thread;
typedef bdb_safe_buffer<void *> bdb_safe_buffer_t;
Expand Down
22 changes: 0 additions & 22 deletions src/blockchain_db/blockchain_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,26 +319,4 @@ void BlockchainDB::show_stats()
<< ENDL
);
}

void BlockchainDB::fixup()
{
if (is_read_only()) {
LOG_PRINT_L1("Database is opened read only - skipping fixup check");
return;
}

// There was a bug that would cause key images for transactions without
// any outputs to not be added to the spent key image set. There are two
// instances of such transactions, in blocks 202612 and 685498.
// The key images below are those from the inputs in those transactions.
// On testnet, there are no such transactions
// See commit 533acc30eda7792c802ea8b6417917fa99b8bc2b for the fix
static const char * const mainnet_genesis_hex = "418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3";
crypto::hash mainnet_genesis_hash;
epee::string_tools::hex_to_pod(mainnet_genesis_hex, mainnet_genesis_hash );
set_batch_transactions(true);
batch_start();
batch_stop();
}

} // namespace cryptonote
7 changes: 0 additions & 7 deletions src/blockchain_db/blockchain_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -1482,13 +1482,6 @@ class BlockchainDB
*/
virtual bool is_read_only() const = 0;

// TODO: this should perhaps be (or call) a series of functions which
// progressively update through version updates
/**
* @brief fix up anything that may be wrong due to past bugs
*/
virtual void fixup();

/**
* @brief set whether or not to automatically remove logs
*
Expand Down
7 changes: 0 additions & 7 deletions src/blockchain_db/lmdb/db_lmdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3146,13 +3146,6 @@ bool BlockchainLMDB::is_read_only() const
return false;
}

void BlockchainLMDB::fixup()
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
// Always call parent as well
BlockchainDB::fixup();
}

#define RENAME_DB(name) \
k.mv_data = (void *)name; \
k.mv_size = sizeof(name)-1; \
Expand Down
3 changes: 0 additions & 3 deletions src/blockchain_db/lmdb/db_lmdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,6 @@ class BlockchainLMDB : public BlockchainDB

virtual bool is_read_only() const;

// fix up anything that may be wrong due to past bugs
virtual void fixup();

// migrate from older DB version to current
void migrate(const uint32_t oldversion);

Expand Down
10 changes: 3 additions & 7 deletions src/cryptonote_basic/cryptonote_format_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,9 @@ namespace cryptonote
switch (std::atomic_load(&default_decimal_point))
{
case 2:
return "stellite";
return "electroneum";
case 0:
return "scent";
return "ecent";
default:
ASSERT_MES_AND_THROW("Invalid decimal point specification: " << default_decimal_point);
}
Expand Down Expand Up @@ -696,11 +696,7 @@ namespace cryptonote
//---------------------------------------------------------------
bool calculate_block_hash(const block& b, crypto::hash& res)
{
crypto::hash block_blob_hash = get_blob_hash(block_to_blob(b));

bool hash_result = get_object_hash(get_block_hashing_blob(b), res);

return hash_result;
return get_object_hash(get_block_hashing_blob(b), res);
}
//---------------------------------------------------------------
bool get_block_hash(const block& b, crypto::hash& res)
Expand Down
3 changes: 1 addition & 2 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,7 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet, const cryptonote::te

if (!fakechain)
{
// ensure we fixup anything we found and fix in the future
m_db->fixup();
m_db->set_batch_transactions(true);
}

m_db->block_txn_start(true);
Expand Down
4 changes: 2 additions & 2 deletions src/version.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define MONERO_VERSION_TAG "@VERSIONTAG@"
#define MONERO_VERSION "1.0.0.0"
#define MONERO_RELEASE_NAME "Cobalt"
#define MONERO_VERSION "1.2.0.0"
#define MONERO_RELEASE_NAME "Chromium"
#define MONERO_VERSION_FULL MONERO_VERSION "-" MONERO_VERSION_TAG

0 comments on commit e9a0d16

Please sign in to comment.