Skip to content

Commit

Permalink
Prosus_Money v0.7.2a (#20)
Browse files Browse the repository at this point in the history
* Prosus_Money v0.7.2a
  • Loading branch information
prosus-money authored and yerkobits committed Oct 27, 2019
1 parent fbfa528 commit 5e2ac22
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 49 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
/build
/tags

2 changes: 2 additions & 0 deletions cryptonote/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git* export-ignore
/CMakeLists.txt export-subst
8 changes: 8 additions & 0 deletions cryptonote/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
/build
/tags
.idea
.ycm_extra_conf.py
.ycm_extra_conf.pyc
Release
Debug
10 changes: 4 additions & 6 deletions cryptonote/src/CryptoNoteConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ const char P2P_STAT_TRUSTED_PUB_KEY[] = "8f80f9a5a434a9f1
const uint32_t P2P_IP_BLOCKTIME = (60 * 60 * 24);//24 hour *v0.6
const uint32_t P2P_IP_FAILS_BEFORE_BLOCK = 10; // *v0.6

const std::initializer_list<const char*> SEED_NODES = { //usar sólo IP, no URL
"18.221.201.1:16180",
"18.188.208.249:16180",
"18.224.229.139:16180",
"165.227.80.161:16180"
const std::initializer_list<const char*> SEED_NODES = {
"explorer.prosus.money:16180",
"prosus.altrui.exchange:16180"
};

struct CheckpointData {
Expand Down Expand Up @@ -151,4 +149,4 @@ const std::initializer_list<CheckpointData> CHECKPOINTS = {





21 changes: 4 additions & 17 deletions cryptonote/src/CryptoNoteCore/Blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,8 @@ bool Blockchain::init(const std::string& config_folder, bool load_existing) {
}

logger(INFO, BRIGHT_GREEN)
<< "Blockchain initialized. last block: " << m_blocks.size() - 1 << ", "
<< Common::timeIntervalToString(timestamp_diff)
<< " time ago, current difficulty: " << getDifficultyForNextBlock();
<< "Blockchain initialized. Last block: " << m_blocks.size() - 1
<< " (" << Common::timeIntervalToString(timestamp_diff) << " time ago)";
return true;
}

Expand Down Expand Up @@ -1979,8 +1978,6 @@ bool Blockchain::pushBlock(const Block& blockData, const std::vector<Transaction
blob_size = toBinaryArray(block.transactions.back().tx).size();
fee = getInputAmount(block.transactions.back().tx) - getOutputAmount(block.transactions.back().tx);

// <ykb //TODO: http://explorer.prosus.money/?hash=3808aed0b00f540f76bd22f38cbb06b6557197e2f7ba05f222ad595b83498ae7#blockchain_transaction
// if ((getCurrentBlockchainHeight() != 403160) && (getCurrentBlockchainHeight() != 403161) && (getCurrentBlockchainHeight() != 403162) ) { // TODO: TXhash, NO BLOCK
if (!checkTransactionInputs(block.transactions.back().tx)) {
logger(INFO, BRIGHT_WHITE) <<
"Block-hash " << blockHash << " has at least one transaction with wrong inputs: " << tx_id;
Expand All @@ -1989,16 +1986,8 @@ bool Blockchain::pushBlock(const Block& blockData, const std::vector<Transaction
block.transactions.pop_back();
popTransactions(block, minerTransactionHash);

/* if (getCurrentBlockchainHeight() == 403161) { // TODO: TXhash, NO BLOCK
return true;
}
else {
return false; //default
} */
return false;
}
// }
// ykb>

++transactionIndex.transaction;
pushTransaction(block, tx_id, transactionIndex);
Expand All @@ -2015,15 +2004,13 @@ bool Blockchain::pushBlock(const Block& blockData, const std::vector<Transaction
int64_t emissionChange = 0;
uint64_t reward = 0;
uint64_t already_generated_coins = m_blocks.empty() ? 0 : m_blocks.back().already_generated_coins;
// <ykb
//if (getCurrentBlockchainHeight() != 403161) {

if (!validate_miner_transaction(blockData, static_cast<uint32_t>(m_blocks.size()), cumulative_block_size, already_generated_coins, fee_summary, reward, emissionChange)) {
logger(INFO, BRIGHT_WHITE) << "Block-hash " << blockHash << " has invalid miner transaction";
bvc.m_verification_failed = true;
popTransactions(block, minerTransactionHash);
return false;
}
//} // ykb>

block.height = static_cast<uint32_t>(m_blocks.size());
block.block_cumulative_size = cumulative_block_size;
Expand Down Expand Up @@ -2581,4 +2568,4 @@ bool Blockchain::isInCheckpointZone(const uint32_t height) {
return m_checkpoints.is_in_checkpoint_zone(height);
}

}
}
17 changes: 8 additions & 9 deletions cryptonote/src/CryptoNoteCore/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,15 +706,14 @@ bool core::update_miner_block_template() {

bool core::on_idle() {
if (!m_starter_message_showed) {
logger(INFO) << ENDL << "**********************************************************************" << ENDL
<< "The daemon will start synchronizing with the network. It may take up to several hours." << ENDL
<< ENDL
<< "You can set the level of process detailization* through \"set_log <level>\" command*, where <level> is between 0 (no details) and 4 (very verbose)." << ENDL
<< ENDL
<< "Use \"help\" command to see the list of available commands." << ENDL
<< ENDL
<< "Note: in case you need to interrupt the process, use \"exit\" command. Otherwise, the current progress won't be saved." << ENDL
<< "**********************************************************************";
logger(INFO)
<< ENDL
<< "****************************************************************" << ENDL
<< "The daemon will start synchronizing with the network. " << ENDL
<< "You can set the level of debug info through \"set_log <level>\" ," << ENDL
<< "where <level> is between 0 (no details) and 4 (very verbose)." << ENDL
<< "****************************************************************" << ENDL
<< ENDL ;
m_starter_message_showed = true;
}

Expand Down
2 changes: 1 addition & 1 deletion cryptonote/src/CryptoNoteCore/Miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ namespace CryptoNote
//we lucky!
++m_config.current_extra_message_index;

logger(INFO, GREEN) << "Found block for difficulty: " << local_diff;
logger(INFO, BRIGHT_BLUE) << "We lucky! Block mined, reward for you.";

if(!m_handler.handle_block_found(b)) {
--m_config.current_extra_message_index;
Expand Down
22 changes: 11 additions & 11 deletions cryptonote/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ bool CryptoNoteProtocolHandler::process_payload_sync_data(const CORE_SYNC_DATA&
int64_t diff = static_cast<int64_t>(hshd.current_height) - static_cast<int64_t>(get_current_blockchain_height());

logger(diff >= 0 ? (is_inital ? Logging::INFO : Logging::DEBUGGING) : Logging::TRACE, Logging::BRIGHT_YELLOW) << context <<
"Sync data returned unknown top block: " << get_current_blockchain_height() << " -> " << hshd.current_height
<< " [" << std::abs(diff) << " blocks (" << std::abs(diff) / (24 * 60 * 60 / m_currency.difficultyTarget()) << " days) "
<< (diff >= 0 ? std::string("behind") : std::string("ahead")) << "] " << std::endl << "SYNCHRONIZATION started";
"returned new top block: " << get_current_blockchain_height() << " -> " << hshd.current_height
<< " [" << std::abs(diff) << " blocks " << (diff >= 0 ? std::string("behind") : std::string("ahead")) << "] "
<< std::endl << "SYNCHRONIZATION started";

logger(Logging::DEBUGGING) << "Remote top block height: " << hshd.current_height << ", id: " << hshd.top_id;
//let the socket to send response to handshake, but request callback, to let send request data after response
Expand Down Expand Up @@ -531,14 +531,14 @@ bool CryptoNoteProtocolHandler::request_missing_objects(CryptoNoteConnectionCont
bool CryptoNoteProtocolHandler::on_connection_synchronized() {
bool val_expected = false;
if (m_synchronized.compare_exchange_strong(val_expected, true)) {
logger(Logging::INFO) << ENDL << "**********************************************************************" << ENDL
<< "You are now synchronized with the network. You may now start simplewallet." << ENDL
<< ENDL
<< "Please note, that the blockchain will be saved only after you quit the daemon with \"exit\" command or if you use \"save\" command." << ENDL
<< "Otherwise, you will possibly need to synchronize the blockchain again." << ENDL
<< ENDL
<< "Use \"help\" command to see the list of available commands." << ENDL
<< "**********************************************************************";
logger(Logging::INFO) << ENDL
<< "****************************************************************" << ENDL
<< "You are now synchronized with the network. " << ENDL
<< "Use \"help\" command to see the list of available options." << ENDL
<< "The blockchain will be saved only after you quit the " << ENDL
<< "daemon with \"exit\" command or if you use \"save\" command." << ENDL
<< "****************************************************************" << ENDL
<< ENDL ;
m_core.on_synchronized();

uint32_t height;
Expand Down
4 changes: 2 additions & 2 deletions cryptonote/src/Daemon/Daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ int main(int argc, char* argv[])
// configure logging
logManager.configure(buildLoggerConfiguration(cfgLogLevel, cfgLogFile));

logger(INFO) << CryptoNote::CRYPTONOTE_NAME << " v" << PROJECT_VERSION_LONG;
logger(INFO, BRIGHT_BLUE) << CryptoNote::CRYPTONOTE_NAME << " v" << PROJECT_VERSION_LONG;

if (command_line_preprocessor(vm, logger)) {
return 0;
}

{
logger(INFO , BRIGHT_BLUE) <<
logger(INFO, BRIGHT_BLUE) <<
"\n \n"
" ================================================================= \n"
" \n"
Expand Down
6 changes: 3 additions & 3 deletions cryptonote/src/version.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define BUILD_COMMIT_ID "antiasic"
#define PROJECT_VERSION "0.6"
#define PROJECT_VERSION_BUILD_NO "8"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"
#define PROJECT_VERSION "0.7"
#define PROJECT_VERSION_BUILD_NO "2"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO " (" BUILD_COMMIT_ID ")"

0 comments on commit 5e2ac22

Please sign in to comment.