diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 3 | ||||
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 2 | ||||
-rw-r--r-- | src/ringct/rctSigs.cpp | 10 | ||||
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 24 | ||||
-rw-r--r-- | src/wallet/password_container.cpp | 6 | ||||
-rw-r--r-- | src/wallet/password_container.h | 2 |
6 files changed, 26 insertions, 21 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index efda3f5cf..70b2ccc79 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -759,6 +759,9 @@ bool Blockchain::rollback_blockchain_switching(std::list<block>& original_chain, pop_block_from_blockchain(); } + // make sure the hard fork object updates its current version + m_hardfork->reorganize_from_chain_height(rollback_height); + //return back original chain for (auto& bl : original_chain) { diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index f0f9102a8..b13c1f437 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -285,7 +285,7 @@ namespace cryptonote int64_t last_block_v1 = 1009826; int64_t diff_v2 = max_block_height > last_block_v1 ? min(abs(diff), max_block_height - last_block_v1) : 0; LOG_PRINT_CCONTEXT_YELLOW("Sync data returned a new top block candidate: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height - << " [" << std::abs(diff) << " Your node is (" << ((abs(diff) - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) " + << " [Your node is " << std::abs(diff) << " blocks (" << ((abs(diff) - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) " << (0 <= diff ? std::string("behind") : std::string("ahead")) << "] " << ENDL << "SYNCHRONIZATION started", (is_inital ? LOG_LEVEL_0:LOG_LEVEL_1)); LOG_PRINT_L1("Remote blockchain height: " << hshd.current_height << ", id: " << hshd.top_id); diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index b7efe3ae7..c7f9b6879 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -750,7 +750,7 @@ namespace rct { for (size_t i = 0; i < rv.outPk.size(); ++i) { if (!results[i]) { - LOG_ERROR("Range proof verified failed for input " << i); + LOG_PRINT_L1("Range proof verified failed for output " << i); return false; } } @@ -761,7 +761,7 @@ namespace rct { DP("mg sig verified?"); DP(mgVerd); if (!mgVerd) { - LOG_ERROR("MG signature verification failed"); + LOG_PRINT_L1("MG signature verification failed"); return false; } @@ -803,7 +803,7 @@ namespace rct { for (size_t i = 0; i < results.size(); ++i) { if (!results[i]) { - LOG_ERROR("Range proof verified failed for input " << i); + LOG_PRINT_L1("Range proof verified failed for output " << i); return false; } } @@ -830,7 +830,7 @@ namespace rct { for (size_t i = 0; i < results.size(); ++i) { if (!results[i]) { - LOG_ERROR("verRctMGSimple failed for input " << i); + LOG_PRINT_L1("verRctMGSimple failed for input " << i); return false; } } @@ -843,7 +843,7 @@ namespace rct { //check pseudoOuts vs Outs.. if (!equalKeys(sumPseudoOuts, sumOutpks)) { - LOG_ERROR("Sum check failed"); + LOG_PRINT_L1("Sum check failed"); return false; } diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index d9c1bb4ed..85bdee16f 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -869,8 +869,10 @@ bool simple_wallet::ask_wallet_create_if_needed() do{ LOG_PRINT_L3("User asked to specify wallet file name."); wallet_path = command_line::input_line( - tr("Specify wallet file name (e.g., MyWallet). If the wallet doesn't exist, it will be created.\n" - "Wallet file name (or Ctrl-C to quit): ") + tr(m_restoring ? "Specify a new wallet file name for your restored wallet (e.g., MyWallet).\n" + "Wallet file name (or Ctrl-C to quit): " : + "Specify wallet file name (e.g., MyWallet). If the wallet doesn't exist, it will be created.\n" + "Wallet file name (or Ctrl-C to quit): ") ); if(std::cin.eof()) { @@ -913,8 +915,8 @@ bool simple_wallet::ask_wallet_create_if_needed() } else if(!wallet_file_exists && !keys_file_exists) //No wallet, no keys { - message_writer() << tr("No wallet/key file found with that name. Confirm creation of new wallet named: ") << wallet_path; - confirm_creation = command_line::input_line(tr("(y)es/(n)o: ")); + message_writer() << tr(m_restoring ? "Confirm wallet name: " : "No wallet found with that name. Confirm creation of new wallet named: ") << wallet_path; + confirm_creation = command_line::input_line(tr("(Y/Yes/N/No): ")); if(std::cin.eof()) { LOG_ERROR("Unexpected std::cin.eof() - Exited simple_wallet::ask_wallet_create_if_needed()"); @@ -2178,7 +2180,7 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri // prompt is there is no payment id and confirmation is required if (!payment_id_seen && m_wallet->confirm_missing_payment_id()) { - std::string accepted = command_line::input_line(tr("No payment id is included with this transaction. Is this okay? (Y/Yes/N/No)")); + std::string accepted = command_line::input_line(tr("No payment id is included with this transaction. Is this okay? (Y/Yes/N/No): ")); if (std::cin.eof()) return true; if (!command_line::is_yes(accepted)) @@ -2260,7 +2262,7 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri float days = locked_blocks / 720.0f; prompt << boost::format(tr(".\nThis transaction will unlock on block %llu, in approximately %s days (assuming 2 minutes per block)")) % ((unsigned long long)unlock_block) % days; } - prompt << tr(".") << ENDL << tr("Is this okay? (Y/Yes/N/No)"); + prompt << tr(".") << ENDL << tr("Is this okay? (Y/Yes/N/No): "); std::string accepted = command_line::input_line(prompt.str()); if (std::cin.eof()) @@ -2431,13 +2433,13 @@ bool simple_wallet::sweep_unmixable(const std::vector<std::string> &args_) std::string prompt_str = tr("Sweeping ") + print_money(total_unmixable); if (ptx_vector.size() > 1) { - prompt_str = (boost::format(tr("Sweeping %s in %llu transactions for a total fee of %s. Is this okay? (Y/Yes/N/No)")) % + prompt_str = (boost::format(tr("Sweeping %s in %llu transactions for a total fee of %s. Is this okay? (Y/Yes/N/No): ")) % print_money(total_unmixable) % ((unsigned long long)ptx_vector.size()) % print_money(total_fee)).str(); } else { - prompt_str = (boost::format(tr("Sweeping %s for a total fee of %s. Is this okay? (Y/Yes/N/No)")) % + prompt_str = (boost::format(tr("Sweeping %s for a total fee of %s. Is this okay? (Y/Yes/N/No): ")) % print_money(total_unmixable) % print_money(total_fee)).str(); } @@ -2655,7 +2657,7 @@ bool simple_wallet::sweep_all(const std::vector<std::string> &args_) // prompt is there is no payment id and confirmation is required if (!payment_id_seen && m_wallet->confirm_missing_payment_id()) { - std::string accepted = command_line::input_line(tr("No payment id is included with this transaction. Is this okay? (Y/Yes/N/No)")); + std::string accepted = command_line::input_line(tr("No payment id is included with this transaction. Is this okay? (Y/Yes/N/No): ")); if (std::cin.eof()) return true; if (!command_line::is_yes(accepted)) @@ -2690,7 +2692,7 @@ bool simple_wallet::sweep_all(const std::vector<std::string> &args_) std::string prompt_str; if (ptx_vector.size() > 1) { - prompt_str = (boost::format(tr("Sweeping %s in %llu transactions for a total fee of %s. Is this okay? (Y/Yes/N/No)")) % + prompt_str = (boost::format(tr("Sweeping %s in %llu transactions for a total fee of %s. Is this okay? (Y/Yes/N/No): ")) % print_money(total_sent) % ((unsigned long long)ptx_vector.size()) % print_money(total_fee)).str(); @@ -2897,7 +2899,7 @@ bool simple_wallet::accept_loaded_tx(const std::function<size_t()> get_num_txes, change_string += tr("no change"); uint64_t fee = amount - amount_to_dests; - std::string prompt_str = (boost::format(tr("Loaded %lu transactions, for %s, fee %s, %s, %s, with min mixin %lu. %sIs this okay? (Y/Yes/N/No)")) % (unsigned long)get_num_txes() % print_money(amount) % print_money(fee) % dest_string % change_string % (unsigned long)min_mixin % extra_message).str(); + std::string prompt_str = (boost::format(tr("Loaded %lu transactions, for %s, fee %s, %s, %s, with min mixin %lu. %sIs this okay? (Y/Yes/N/No): ")) % (unsigned long)get_num_txes() % print_money(amount) % print_money(fee) % dest_string % change_string % (unsigned long)min_mixin % extra_message).str(); return command_line::is_yes(command_line::input_line(prompt_str)); } //---------------------------------------------------------------------------------------------------- diff --git a/src/wallet/password_container.cpp b/src/wallet/password_container.cpp index 480d132e7..5260bbc8b 100644 --- a/src/wallet/password_container.cpp +++ b/src/wallet/password_container.cpp @@ -144,19 +144,19 @@ bool password_container::read_from_tty_double_check(const char *message) { std::string pass2; bool match=false; bool doNotVerifyEntry=false; + if (m_verify){message = "Enter a password for your new wallet";} do{ if (message) std::cout << message <<": "; if (!password_container::read_from_tty(pass1)) return false; if (m_verify==true){//double check password; - if (message) - std::cout << message << ": "; + std::cout << "Confirm Password: "; if (!password_container::read_from_tty(pass2)) return false; if(pass1!=pass2){ //new password entered did not match - std::cout << "Passwords do not match" << std::endl; + std::cout << "Passwords do not match! Please try again." << std::endl; pass1=""; pass2=""; match=false; diff --git a/src/wallet/password_container.h b/src/wallet/password_container.h index 62f43aa37..866d170f2 100644 --- a/src/wallet/password_container.h +++ b/src/wallet/password_container.h @@ -48,7 +48,7 @@ namespace tools bool empty() const { return m_empty; } const std::string& password() const { return m_password; } void password(std::string&& val) { m_password = std::move(val); m_empty = false; } - bool read_password(const char *message = "password"); + bool read_password(const char *message = "Password"); private: //delete constructor with no parameters |